In the context of a real-world application, the client is interested to know about "simpler solutions". This makes the implementation of the solution an easier task. This sounds like a reasonable question. The modeling implications are not that trivial, however.
As a highly simplified example consider the solution:
We see we have a different pattern for each time period \(t\). The question is: can we reduce the number of different patterns? Say, we want to allow just 4 different patterns.
One way to model this is to have a pool of candidate patterns \(y_{c,i}\) with 4 candidates \(c\). Then use a standard assignment-like construct to pick from those candidates;\[\begin{align}&x_{t,i} = \sum_c \mathit{select}_{t,c}\cdot y_{c,i}\\& \sum_c \mathit{select}_{t,c}=1&&\forall t\end{align}\] Unfortunately this is non-linear as both \(\mathit{select}_{t,c}\) and \(y_{c,i}\) are decision variables. We can solve this with a number of solvers such as global MINLP solvers (Baron, Couenne, Antigone), or global MIQCP solvers (Gurobi). The solution can look like:
The results look like:
This linearized formulation yields the same solution as the quadratic formulation shown earlier.
As a highly simplified example consider the solution:
---- 32 VARIABLE x.L patterns
i1 i2 i3 i4 i5 i6 i7 i8
t1 14321124
t2 3535413
t3 11322211
t4 34134213
t5 14113432
t6 2122133
t7 4134311
We see we have a different pattern for each time period \(t\). The question is: can we reduce the number of different patterns? Say, we want to allow just 4 different patterns.
Quadratic formulation
One way to model this is to have a pool of candidate patterns \(y_{c,i}\) with 4 candidates \(c\). Then use a standard assignment-like construct to pick from those candidates;\[\begin{align}&x_{t,i} = \sum_c \mathit{select}_{t,c}\cdot y_{c,i}\\& \sum_c \mathit{select}_{t,c}=1&&\forall t\end{align}\] Unfortunately this is non-linear as both \(\mathit{select}_{t,c}\) and \(y_{c,i}\) are decision variables. We can solve this with a number of solvers such as global MINLP solvers (Baron, Couenne, Antigone), or global MIQCP solvers (Gurobi). The solution can look like:
---- 49 VARIABLE y.L candidate patterns
i1 i2 i3 i4 i5 i6 i7 i8
cand1 34134213
cand2 14212133
cand3 3535413
cand4 11333211
---- 49 VARIABLE select.L select from candidates
cand1 cand2 cand3 cand4
t1 1
t2 1
t3 1
t4 1
t5 1
t6 1
t7 1
---- 49 VARIABLE x.L patterns
i1 i2 i3 i4 i5 i6 i7 i8
t1 14212133
t2 3535413
t3 11333211
t4 34134213
t5 14212133
t6 14212133
t7 11333211
Indeed we see that the \(x\) variables show four different patterns.
Note again that all these quantities (\(x\), \(y\), and \(\mathit{select}\)) are endogenous (i.e. determined by the solver).
Linearization
We can linearize this approach. First, we assume the variables \(x\) and \(y\) are bounded: \[x_{t,i}, y_{c,i} \in [0,U]\] We define \[sy_{t,c,i} = \mathit{select}_{t,c}\cdot y_{c,i}\] With this we can formulate the linearization: \[\begin{align}& sy_{t,c,i} \le \mathit{select}_{t,c} \cdot U \\ & sy_{t,c,i} \le y_{c,i} \\ & sy_{t,c,i} \ge y_{c,i} - U(1-\mathit{select}_{t,c}) \\ &x_{t,i} = \sum_c sy_{t,c,i} \\ & sy_{t,c,i} \in [0,U]\end{align}\]
The results look like:
---- 62 VARIABLE y.L candidate patterns
i1 i2 i3 i4 i5 i6 i7 i8
cand1 14212133
cand2 11333211
cand3 3535413
cand4 34134213
---- 62 VARIABLE select.L select from candidates
cand1 cand2 cand3 cand4
t1 1
t2 1
t3 1
t4 1
t5 1
t6 1
t7 1
---- 62 VARIABLE sy.L sy=select*y
i1 i2 i3 i4 i5 i6 i7 i8
t1.cand1 14212133
t2.cand3 3535413
t3.cand2 11333211
t4.cand4 34134213
t5.cand1 14212133
t6.cand1 14212133
t7.cand2 11333211
---- 62 VARIABLE x.L patterns
i1 i2 i3 i4 i5 i6 i7 i8
t1 14212133
t2 3535413
t3 11333211
t4 34134213
t5 14212133
t6 14212133
t7 11333211
This linearized formulation yields the same solution as the quadratic formulation shown earlier.