problem MasterProblem ;# ---------------------------------------param nRun integer >=0 , default 0;set Run ; # these are like routes.set Trip; # these are tasks that must be done or nodes that must be visited.param TripInRun {1..nRun,Trip};param RunCost {1..nRun};var Schedule {1..nRun} integer >=0 ; #binary; # = 1 if run j in R is selected. 0 otherwise.minimize ServiceCost: # no resource constraints in this problemsum {j in Run: j <= nRun} RunCost[j] * Schedule[j] ;subj to TripCovering {i in Trip}:sum {j in Run: j <= nRun} Schedule[j] * TripInRun [j,i] >= 1 ;problem PricingProblem;# ---------------------------------------param price {Trip} default 0;var Use {1..nRun} integer >=0;minimize ReducedCost:sum {j in 1..nRun} (RunCost[j] - sum {i in Trip} price[i] * TripInRun[j,i]) * Use[j];subj to Pick_Run_Column:sum {j in 1..nRun} Use[j] >=1;
problem MasterProblem;option relax_integrality 1;option presolve 0;problem PricingProblem;option relax_integrality 0;option presolve 1;let nRun := 0;for {i in Trip} {let nRun := nRun + 1;display nRun;};repeat {solve MasterProblem;let {i in Trip} price[i] := TripCovering[i].dual;solve PricingProblem;if ReducedCost < -0.00001 then {let nRun := nRun + 1;}else break;};display Schedule, ServiceCost;option MasterProblem.relax_integrality 0;option MasterProblem.presolve 10;solve MasterProblem;display Schedule, ServiceCost;
Error at _cmdno 224 executing "solve" command(file C:\..., line 41, offset 978):error processing param TripInRun:64540 invalid subscripts discarded:TripInRun[71,1]TripInRun[71,2]TripInRun[71,3]and 64537 more.Error at _cmdno 224 executing "solve" command(file C:\..., line 41, offset 978):error processing param RunCost:922 invalid subscripts discarded:RunCost[71]RunCost[72]RunCost[73]and 919 more.CPLEX 12.7.0.0: optimal solution; objective 4006 dual simplex iterations (0 in phase I)CPLEX 12.7.0.0: optimal integer solution; objective 00 MIP simplex iterations0 branch-and-bound nodesNo basis.Schedule [*] :=1 1 8 0 15 0 22 0 29 0 36 0 43 0 50 0 57 0 64 02 1 9 0 16 0 23 0 30 0 37 0 44 0 51 0 58 0 65 03 0 10 0 17 0 24 0 31 0 38 0 45 0 52 0 59 0 66 04 0 11 0 18 0 25 0 32 0 39 0 46 0 53 0 60 0 67 05 0 12 0 19 0 26 0 33 0 40 0 47 0 54 0 61 0 68 06 0 13 0 20 0 27 0 34 0 41 0 48 0 55 0 62 0 69 07 0 14 0 21 0 28 0 35 0 42 0 49 0 56 0 63 0 70 0;ServiceCost = 400CPLEX 12.7.0.0: optimal integer solution; objective 4000 MIP simplex iterations0 branch-and-bound nodesNo basis.Schedule [*] :=1 1 8 0 15 0 22 0 29 0 36 0 43 0 50 0 57 0 64 02 1 9 0 16 0 23 0 30 0 37 0 44 0 51 0 58 0 65 03 0 10 0 17 0 24 0 31 0 38 0 45 0 52 0 59 0 66 04 0 11 0 18 0 25 0 32 0 39 0 46 0 53 0 60 0 67 05 0 12 0 19 0 26 0 33 0 40 0 47 0 54 0 61 0 68 06 0 13 0 20 0 27 0 34 0 41 0 48 0 55 0 62 0 69 07 0 14 0 21 0 28 0 35 0 42 0 49 0 56 0 63 0 70 0;ServiceCost = 400
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/pX7z1stk-uY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/pX7z1stk-uY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+unsubscribe@googlegroups.com.
To eliminate 10 constraints from the problem means that they don't fulfil the requirements sets by bounds?
Or they don't get fit into the problem?
--
Best Regards
M. Umar Khan
On Fri, Feb 16, 2018 at 8:11 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Yes, the problem is simple enough to be solved in the preprocessing stage. There are two preprocessing happens when you send solve command. AMPL runs presolve and tries to eliminate the constraints and variables. You can read about AMPL presolve at https://ampl.com/BOOK/CHAPTERS/17-solvers.pdf. The solver also perform preprocessing after AMPL send the problem to solver. So, it seems that AMPL eliminated 10 constraints from your problem in its presolve phase.
--
Paras Tiwari
am...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.