# Tag Info

6

If your linear program does not have an optimal solution one of three things might be the case: The solver didn't find the optimal solution, even though it exists. This might be due to runtime or storage space limitations. However this should rarely be the problem, unless you have huge LPs. There is no optimal solution, because the problem is unbounded and ...

5

A TSP with a fixed starting point and no return to start, can be solved as an ordinary TSP with all the in-going arcs to the starting point having a cost of zero. That way the return to the starting point is "for free" and the TSP solver only focuses on the remaining part of the tour, giving you an optimal "open TSP".

5

CP-SAT uses a SAT backend. But at any moment, just like with SMT solvers, the full model is never fully represented using clauses and Boolean literals. I recommend looking at the CPAIOR 2020 masterclass on CP (on YouTube) to get a better understanding of the architecture of the solver.

5

I assume fab_rate is variable, otherwise you can just test it. You can use temporary variables: non_zero_fab_rate = model.NewIntVar(1, ..) fab_rate_is_zero = model.NewBoolVar(..) model.Add(non_zero_fab_rate == 1).OnlyEnforceIf(fab_rate_is_zero) model.Add(non_zero_fab_rate == fab_rate).OnlyEnforceIf(fab_rate_is_zero.Not()) model.Add(fab_rate == 0)....

5

1 500 nodes is a lot... don't expect any MILP solver to find decent solutions quickly (or at all). See for example @LocalSolver's benchmarks. Which brings me to my next point: for big graphs, maybe LocalSolver is the way to go. I also think its worth giving or tools a try. The API is not that user friendly (in my opinion), but the optimization engine is ...

5

Try: SetSolverSpecificParametersAsString("heuristics/completesol/maxunknownrate = 0.9") References: SCIP params SetSolverSpecificParametersAsString usage

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.

4

Please read https://github.com/google/or-tools/blob/stable/ortools/sat/doc/channeling.md OnlyEnforceIf() only accept one or more Boolean literals. So for the first constraint (assuming there is an error in the direction of the comparisons): b1 = model.NewBoolVar() model.AddLinearConstraint(number_of_machines, 6, 10).OnlyEnforceIf(b1) model.Add(line == 8)....

4

Economically speaking, if there is no cost of reprogramming your cutter (be it a CNC machine or a bearded handyman), there is no reason to go on and cut out all four rectangles from the next plywood sheet, if you only need one more. In this realistic scenario, you need a bit more control variables, than specified in the first attempt: 12 vs 3. If we allow ...

4

You need to install the binary package locally, with a correct license. It should pick it up at this point.

4

Vehicle routing problems in the real world often require custom scenarios, and no VRP solver does everything, so this is a good question. The VRP solver in OR-Tools is open source (you could fork it and add your own customizations if you wanted), and new features have been added to it continually for over a decade. And speaking for Google, we're committed to ...

3

The model you linked in the question will do the job. You just set $a_{jt}=0$ if a worker on shift $j$ would be taking a break at time $t$.

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

"Sub-optimal" is a global optimisation term. In global optimisation, we refer to a "sub-optimal" solution as a solution that is optimal, i.e., it satisfies KKT, but is not the global solution (its value is not the best it can be, hence the term sub-optimal). It is important to note that the counterpoint to "sub-optimal" is not &...

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 ...

2

To have resources being released at given time points, you have two options. Have one optional interval per time interval. This interval always ends at the end of the interval. For a given demand, one of the optional intervals must be selected. And the presence literal of the optional interval implies that the start of the main interval is equal to the ...

1

You should look at this example: https://github.com/google/or-tools/blob/stable/ortools/sat/doc/scheduling.md#intervals-spanning-over-breaks-in-the-calendar

1

The large instance is very hard to solve. I need to spend some time on it, but I lack ideas and time. The flags part is problematic with jupyter notebook. We will fix those. To print intermediate solution, you need a callback. See this code sample

1

I believe the warning comes from SCIP. So check the documentation there.

1

Your objective function doesn't include the cost of buying singles, so you are only minimizing the cost of doing cuts, not the total cost to acquire 20 circles and 15 rectangles (so of course, making no cuts at all gives you the minimal solution). For any potential x,y,z solution point, you will actually need to buy 20-(4x+2z) single circles at 45 each and ...

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.

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