Native multi objective optimization - #2522
Conversation
|
An overview of changes I make in this PR (code deletions not included):
|
|
I have a problem with Say I have a connector node with a where For Annoyingly, binary variables can be used to fixed this, while I just got rid of them all. The binary variable basically says: if I'm in a positive flow scenario the extra flow cannot be negative, and vice versa. The |
|
There is a way to fix this for For Edit: I think actually it might be fixable for |
|
OK, the dust has finally settled on this PR. The PR description and the overview of changes are up to date. I think the end result is really nice:
|
|
Hi @SouthEndMusic
Yes, we expecte these variables to be filtered out by presolve. |
jarsarasty
left a comment
There was a problem hiding this comment.
This implementation should significantly improve performance. Further testing is recommended to evaluate the effectiveness of this new approximation approach that does not use binary decision variables. Excellent job, @SouthEndMusic!
verheem
left a comment
There was a problem hiding this comment.
Nice work, this was a huge chunk. I have only some small remarks
All comments were addressed
Fixes #2233 (To be precise: the multi-objective optimization is now handled by MultiObjectiveAlgorithms.jl and not by HiGHS, this was advised here.)
Fixes #2323 (it has been made a goal anyway, the reduction factors are maximized)
Fixes #2507
Fixes #2399
In the following we assume lexicographic multi-objective optimization.
UserDemand and FlowDemand
Say we have a subnetwork with UserDemand nodes$UD$ and FlowDemand nodes $FD$ and each node $v \in UD \cup FD$ has demands for priorities $P_v$ . Then for every one of these demand nodes for every priority for which they have a demand (at some point in time) we define a special flow decision variable which denotes how much is allocated to that node for that priority:
As indicated, each of these allocated flow variables is bounded between 0 and the corresponding demand (NOTE: in this text we assume that the demands are already expressed in the scaled flow unit). For UserDemand nodes we have that the sum of these allocated flow variables over the priorities is equal to the total flow into that node:
Note that this means that we enforce that only allocated flow can enter a UserDemand node, and so there can not be more flow into the UserDemand node than the total demand of that node.
For FlowDemand we do allow that there is more flow through the node with the flow demand than the total demand (or even negative flow). To allow this freedom, we introduce a special 'demand priority 0' variable
We only let$F^0_v$ account for surplus flow, because if we allow that variable to be negative it can be used to allocate to demands. To make sure we still account for the possibility that the flow through the node with the flow demand is negative, we allow the allocated flow variable with the earliest priority to be negative, and account for this when writing the results.
With this we formulate the constraints
We define relative error variables per demand node per priority for which they have a demand:
The constraints on these relative error terms are similar as before:
With these relative error terms we formulate an objective per demand priority for which any of these nodes have a demand ($P^\text{flow} = \bigcup_{v \in UD \cup FD} P_v$ ):
Note the multiplication by the demand here, which makes this effectively a minimization in the absolute error. There is a reason we formulate relative in stead of absolute errors: to optimize for a fair distribution of water. To that end we can formulate per demand priority a global relative allocation error:
where in practice we multiply both sides by the denominator to prevent division by zero problems. Also note that the enumerator is precisely the expression for the aforementioned objective.$G^p$ . So we define new errors
Now in a subsequent objective, we want to penalize relative errors being larger than
on which we define the constraints
and with which we formulate the objectives
Of course the order of objectives is important. For each demand priority of the flow type described here, first the weighted sum of the errors$E_v^p$ must be minimized, then the sum of the errors $\overline{E}_v^p$ .
Edge cases
I think this formulation is quite robust against edge cases. When a demand$d_v^p$ is zero the constraints on the corresponding allocated flow variable reduce to $F_v^p = 0$ . The corresponding relative error variable $E_v^p$ is neither in any constraint nor in the objective function, is that bad or is that variable then filtered out in the presolve? When all demands of a particular demand priority $p$ are zero, $G_p$ is not in any constraint, will that also be handled by the presolve?
LevelDemand
Say we have basins with LevelDemand$B$ where each basin $b \in B$ has a minimum level $h_{b,\min}^p$ for demand priorities $P^\min_b$ and a maximum level $h_{b,\max}^p$ for demand priorities $P_b^\max$ . Furthermore each basin has a level to storage function $s_b(h)$ . For all basins $b$ in the subnetwork (not just the ones with a level demand) we also have
For basins with a level demand$b \in B$ we additionally have
which is the volume of water needed to get to the minimum level of the current demand priority from the minimum level of the previous demand priority (or the starting level if that's higher). If there is no priority in$P_b^\min$ lower than the current priority $p$ we say $h^{\text{prev}(p)}_{b, \min}$ is equal to the Basin bottom.
which is the volume of water needed to get from the maximum level of the current demand priority to the maximum level of the previous demand priority (or the starting level if that's lower). If there is no priority in$P_b^\max$ lower than the current priority $p$ we say $h^{\text{prev}(p)}_{b, \max} := \infty$ .
We define the following constraints on the errors:
Note that unlike with UserDemand and LevelDemand, the allocated amounts are not present as variables in the problem. The allocated amounts have to be derived from$\Delta S_b$ . Also note that the demands, which depend on the state of the physical layer and the start of the allocation timestep, do not appear in the LP problem. These are only computed for output.
Then given all this we define the objective for minimizing the absolute error sum per priority for which there is at least one level demand ($P_\text{lower}^\text{level} = \bigcup_{b \in B} P^\min_b$ , $P_\text{upper}^\text{level} = \bigcup_{b \in B} P^\max_b$ , $P^\text{level} = P_\text{lower}^\text{level} \cup P_\text{upper}^\text{level}$ ):
Now, just as in the previous section, we want to add a subsequent objective for fair distribution. Given the Basin area$A_b$ (which is assumed to be constant over the allocation timestep), we can define the average lower and upper level error
Again we define new errors:
On these errors we define the following constraints:
and the following objectives:
@jarsarasty