I am modelling a project in which doing some tasks before others will save time. I think that the model is correct - but even though I have only entered the savings for 1 task into the objective function, it is taking too long to run. I believe that the problem lies in my "before1" and "before2" conditions, each of which contain 15^4=50625 modelling variables. These conditions are needed to enable the before variable, where before[a,b]=1 means that task a will be completed before task b.
The variable position is working correctly (position=3 means that task five will be done third). I could eliminate the huge amount of work being done in the "before1" and "before2" conditions if I could make use of these position variables. Could anyone advise me how I can achieve the following, please?
* if position[a] > position[b], then before[a,b] = 0
* if position[a] < position[b], then before[a,b] = 1
Thanks for any suggestions!
Model appended below:
>> I solved your enclosed model in 350sec. using SCIP (Answer was "5" ) with no special settings.
Using glpk2gams and GAMS/Gurobi this was solved in 7.5 seconds:
BLOCKS OF EQUATIONS 44,147 SINGLE EQUATIONS 44,147
S O L V E S U M M A R Y
MODEL m OBJECTIVE gamsobjvar
**** SOLVER STATUS 1 Normal Completion
RESOURCE USAGE, LIMIT 7.548 1000.000
There are better formulations: this test was done on the original model (unchanged, except for the conversion to GAMS).