LINGO: Partitioning a set of indices in optimization models?

10 Views Asked by At

I need your help regarding solving an optimization problem in LINGO programming. Assume that there is a set of parameters and variables; e.g., Vark/ 1..18 /. I need to partition this set into three sets A, B (it has only one member), and C. The objective function includes the summation of three terms where

  • the first term is calculated based on indices only A,
  • the second term is calculated on B (with a single index), and
  • the third term is calculated based on indices only in C. So, the partition (i.e., B) moves between 2 to 17 in the example. Then, the combinations are as follows: 1, 2, 3..18 1..2, 3, 4..18 1..3, 4, 5..18 . . . 1..16, 17, 18 Then, the model is run once for each of the above combinations. Then, the optimal answer for the combinations is compared, and the output is the best. I have written the code for only one combination. How can we define a moving index on Vark and push the model to use @SUM for each set separately?

Example (real model): Please see my math model below. Parameters are $\beta_c, \beta_m, \beta_n, r_c, r_c, \varepsilon$, and $h_k$ ($k=1..18$). Variables are $x_k$ and $y_k$ ($k=1..18$). Therefore, for a given index $b$, we have:

$Min \sum^{b-1}_{k=1}{\beta_c\frac{{x_k}^2}{2h_k(h_k-r_cx_k)}}$

$+\beta_m\frac{x_by_b}{2h_b(h_b-r_cx_b-r_ny_b)}+$

$\sum^{18}_{k=b+1}{\beta_n\frac{{y_k}^2}{2h_k(h_k-r_ny_k)}}$

s.t.

$\sum^{18}_{k=1}{x_k}=1$

$\sum^{18}_{k=1}{y_k}=1$

$h_k-r_cx_k\ge \varepsilon ,\ \forall k=1..b-1$

$h_b-r_cx_b-r_ny_b\ge \varepsilon$

$h_k-r_ny_k\ge \varepsilon ,\ \forall k=b+1..18$

$x_k,y_k\le 1,\ \forall k=1..18$

$x_k,y_k\ge 0,\ \forall k=1..18$

Therefore, the model is supposed to run for (@For $b=2..17$ to find the best solution among 16 models. (of course, some combinations are not feasible). Thank you so much!