We have 3 demand nodes and 1 facility. Collective demand of 3 nodes is greater than capacity of facility but their individual demands are less then capacity of facility. We want to assign maximum demand to facility.
My problem is not about C++, actually it was easiest way to explain my problem in this language. I actually want to formulate above C++ conditions into a mathematical equation.
But is not clear because structures are not closed. Two open braces but only one closed. In the other hand, when you say "where" is similar to "for"? Maybe, this could be more clear if you share the exact block of C++ code (if the problem is not C++).