Originally posted by: hubsi
hi,
i'm currently modelling a scheduling problem for a university course on constraint programming and since i got a license over ibm onthehub program, i wanted to try the cplex CP solver.
So far I have successfully modelled the problem and small instances can be solved optimally in just a few moments. However, even though larger instances can be decided, i am not able to get an optimal solution (actually not necessarily optimal, just compared to the fitness achieved by some colleagues - even though my solutions are already quite good :) ).
of course i know that i have to improve my model, but since i'm using a highly sophisticated commercial tool, i also want to test other approaches (also to discuss these techniques in my report).
i know that there is always a tradeoff between number of variables and constraints and hence i tried to minimize both.. but of course that is not always possible.
the decision part is rather easy (scheduling with some precedence constraints) and i modelled this with 2n variables and element constraints + lessthan
however the optimization goal is rather complex and i had to introduce several new variables (some binary maps & co roughly O(n^2) variables per map and some arrays with O(n) with a rather small integer domain ) and several constraints (element, min, max, and, ...).
so to finally get to the point:
- i have used the ifthenelse constraint. how expensive is it in practice? should it be avoided? what about logical combination of constraints? i avoided 'or' for obvious reasons but what about 'and'? it made my model much simpler but are these combined constraints expensive in the cplex cp implementation?
- i tried to improve my model by removing some auxiliary variables by using more complex terms in the constraints. it seemed to speed up the search a little bit. of course there is no general answere to this question since this highly depends on the scenario at hand, but are there any practical tips for the cplex cp solver?
- some of my variables directly depend on the value of others. eg when assigning one job to a slot, a variable for some location has a fixed value. of course this should be handled by constraint propagation but are there any possibilities to tune this/ configure this for some pairs. eg. if variable x is set then automatically consider variable y for constraint prop first?
- i also tried to use phases to first consider my decision variables and then the 'optimization vars'. however the improvement was negligible.. can someone give me some tips on how to use the phases properly?
- some time ago i also modelled a similar problem with the milp solver and using a shared memory machine with >8 cores seemed to be super fast. however for the cp solver my notebook with a 6th gen i7 dual core is faster than these machines.. i also played a little with the parallel mode config (deterministic or not ..) but without success. any tips on that?
best regards
#CPOptimizer#DecisionOptimization