coin-or-cbc

How to ask for second best solution to a MIP using JuMP

房东的猫 提交于 2020-06-14 04:06:54
问题 I have a Mixed Integer Programming problem. I can use JuMP to find the optimal solution. But how can I find the second best solution? Or the third-best etc. This potentially might be another equally optimal solution, or it might be a worse solution, or it might be :Infeasible -- there might be no most solutions. I know for a TSP-like problem, I can find additional solutions by progressively removing links that are on the optimal path (I.e setting the distances between some of the cities to be

Pyomo - Location of Log Files

扶醉桌前 提交于 2019-12-24 18:30:06
问题 Pretty basic question, but where can I find solver log files from Pyomo? I have a local installation of the COIN-OR solvers on an Ubuntu machine. This is happening in a Jupyter notebook, but I'm getting the same error message when I run the .py file from terminal. solverpath_exe='~/COIN-OR/bin/couenne' opt = SolverFactory('couenne', executable = solverpath_exe) opt.solve(model,tee=True) --------------------------------------------------------------------------- ApplicationError Traceback

How to add Logical constraints in PuLP

偶尔善良 提交于 2019-12-12 02:42:40
问题 I am trying to solve FLP using PuLP. I want to add logical constraint for variable value. I have LpVariable f and C is list of LpVariables . I want to add f to the constraint of problem and which depends on values of c[i]. Below is code snippet > prob = LpProblem("The MILP problem", LpMinimize) Added 1st constraint : prob += lpSum(c[i] for i in range (len(c))) == 2 Now I want to add following constraint: if`lpSum(c[i] for i in range (len(c))) > 1: ` prob += f == 1 else: prob += f == 0 prob +=

What happens when I modified the RHS of a constraint (GLPK)?

亡梦爱人 提交于 2019-12-01 13:20:58
I am increasing the RHS of less-than-or-equal constraint of a MIP problem with GLPK. However, sometimes, after re-optimizing, GLPK cannot find any feasible solution within the time limit. So I am guessing it does not check if the previous solution was feasible. Does anybody have any experience with that? Or can point me to a document that is not the source code itself? Also, I would like to know what is the workflow after I add a constraint for any other solver (e.g. Gurobi, Cplex, SCIP, CBC) so any information is helpful. Cheers! After changing something in the model, all solving information

What happens when I modified the RHS of a constraint (GLPK)?

社会主义新天地 提交于 2019-12-01 11:49:25
问题 I am increasing the RHS of less-than-or-equal constraint of a MIP problem with GLPK. However, sometimes, after re-optimizing, GLPK cannot find any feasible solution within the time limit. So I am guessing it does not check if the previous solution was feasible. Does anybody have any experience with that? Or can point me to a document that is not the source code itself? Also, I would like to know what is the workflow after I add a constraint for any other solver (e.g. Gurobi, Cplex, SCIP, CBC)