# Tag Info

13

The Graph Coloring example shipped with CP optimizer (file: color.cpp in the examples directory): #include <ilcp/cp.h> const char* Names[] = {"blue", "white", "yellow", "green"}; int main(int , const char * []){ IloEnv env; try { IloModel model(env); IloIntVar Belgium(env, 0, 3, "B"), Denmark(env, 0, 3, "DK"), ...

9

What Nikaza said, and also: problems of this kind often have a large number of solutions that differ only by trivial permutations/relabellings/reorderings. For example, if one worker is assigned 10 tasks that can be done in any order with no change to the objective, then there are 10! = 3628800 solutions that will have exactly the same OF. If another worker ...

6

CPLEX is probably spending 15 hours trying to reduce the optimality gap. This is very common issue in MILP problems. The way MILPs are solved is commonly to make all integers continuous and solve the resulting LP. That is called the linear relaxation, and its solution provides a valid lower bound (if we are minimising) on the objective function. The ...

4

I think that you're looking for function IloCP::typeOfPrev. Its documentation is for example here, the description of the general concept is here. Basically, each interval participating in sequence variable can have a type. By default each interval has different type counted from 0 in the order as they are specified in the sequence variable. So type of the ...

4

I assume that you want to model your problem in OPL. Here is a sketch of the model. using CP; range Hours = 1..24; range Machines = 1..5; // Data are just random: int price1[Hours] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; int price2[Hours] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...

4

Other options: Run your model from the command line using oplrun. Using option -d you can specify to dump your model into a cpo file. Specify environment variable ILC_MODEL_DUMP_FILE. Before solving the model CP Optimizer tests this variable and if present it dumps the current model into the specified file (the variable can also specify the path to the file)...

4

The steps taken from the IBM Knowledge Center are: Create a new settings file Change the export format to CPO Add the settings file to the default run configuration Run the run configuration Thanks to @Mark L. Stone who provided the link.

3

CP Optimizer is doing a search for progressively better solutions. Each time it finds a feasible solution, it restricts the remainder of the search to solutions with better objective values than what it just found. So you should get a sequence of progressively better solutions. Given enough time and memory, it will exhaust the search space, and the last ...

3

I'm not a CP Optimizer user, so this may be clunkier than necessary (by an order of magnitude). I'm going to assume that your setup times satisfy the triangle inequality (meaning it's faster to go straight from A to B than from A to C to B). For each place where you would use an interval variable for down time, you could instead create multiple interval ...

3

The automatic search of CP Optimizer does not try to recognize a graph colouring problem. As you notice, fixing the colour of one variable to get rid of some symmetries in the model may help. Extending this idea and fixing the colours of one clique may further help. Such dominance rules are not automatically inferred in CP Optimizer but are let to the user ...

2

I am fairly certain that you cannot resume solution from the previous final state after altering the model. This is a known fact with CPLEX, presumably the same with CPOptimizer for essentially the same reason: the final state of the previous solve may not be valid for the modified problem. For instance, if you were to drop constraints and resume, the true ...

2

within 4s with your data set CPLEX both MIP and Constraint Programming prove optimality In OPL int n1=164; int n2=2; range r1=1..n1; range r2=1..n2; int values[i in r1][j in r2]=0; execute { // Read in file the 2D array values with seperator sep and ranges range1 and range2 function read2D(file,range1,range2,values,sep) ...

2

According to you mentioned, it sounds like the Resource‐Constrained Project Scheduling Problem (RCPS). To execute such a problem with CPLEX, you have two different options. First, develop a mixed-integer programming model and solve it using CPLEX solver. Second, using constraint programming with CPLEX/CPO. For the first option, some examples could be ...

1

The answer provided by Joris Kinable is correct for CP Optimizer versions up to 12.7.1 Starting from 12.8.0 they made changes in the API (more info here). What this basically means is that you should change IloCP to IloCPEngine (in .hpp and .cpp files), and you are more or less set to go!

Only top voted, non community-wiki answers of a minimum length are eligible