julia-mpsge / MPSGE_MP.jl

MIT License
1 stars 0 forks source link

Shadow variables on large cost functions #14

Closed mitchphillipson closed 4 months ago

mitchphillipson commented 4 months ago

Cost functions have the form

$$\sum_{c\in \text{children}} \frac{Qc}{Q{tot}}\cdot CF_c$$

where $Qc$ is the quantity of child $c$, $Q{tot}$ is the total quantity of the children and $CF_c$ is the cost function of the child. When a node has a large number of terms (greater than 1000), this cost function becomes large enough to potentially make the computation infeasible.

The solution is to introduce a shadow variable and constraint. If the variable is named $V$, the constraint is

$$\text{cost function} - V \perp V$$

This simplification greatly reduces memory usage and computation time.