Hot answers tagged

5

the library needs to find the gurobi shared library before you can create the solver. You can set GUROBI_HOME to help. you can have callbacks, but only in c++. Look for or-tools/linear_solver/linear_solver.h. Search for callbacks.


3

Aside https://medium.com/@AlainChabrier/warm-start-optimization-ac73eef189e9 In the documentation: Adds a MIP start, defined by a range of numeric variables and corresponding values, with its name and an effort level. Namespace: ILOG.CPLEX Assembly: ILOG.CPLEX (in ILOG.CPLEX.dll) Version: 20.1.0.0


2

This looks like a plain C# programming error. Don't set startvar and startval to null before calling AddMIPStart. Remove square brackets from startvar and startval in the cal to AddMIPStart.


2

Running the C# version with or-tools master "/usr/local/share/dotnet/dotnet" run --no-build --project examples/tests/wrong_solution_flex_sat.csproj [[[[3, (0, 1)],[1, (1, 2)],[5, (2, 3)]],[[2, (3, 4)], [4, (1, 2)], [6, (2, 3)]], [[2, (0, 1)], [3, (1, 2)], [1, (2, 3)]]],[[[2, (0, 1)], [3, (1, 2)], [4, (2, 3)]], [[1, (0, 1)], [5, (1, 2)], [4, (2, 3)]...


2

A few hours after posting my question here I found a concept I was not familiar with called channelling : https://github.com/google/or-tools/blob/stable/ortools/sat/doc/channeling.md I used it for my needs and it seems to works. I find a bit odd the way I set my variable b, but anyway... For those it can help, my code now looks like : var DiffList = new ...


1

1 constraint on 1 job wasn't applied on code 2 because sketchy implementation of a if statement. Fixed it and updated the code on GitHub for people who need smtg similar.


1

The sum(bool_vars) tells you each job has only one way to be executed. It does not tell you what is 'a' way. You can reuse the bool_var from each alternative in multiple resources.


1

As suggested in the comments above, I went with the circuit constraint. While I am not yet sure whether it helps with the performance, it certainly offers a lot more control over the relations between pairs of variables - here specifically it allows forcing a constraint that an event starts at the end of the previous event. foreach (var group in events....


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