Ask Your Question
1

How to stop a MILP before it reaches the optimal solution (using different backends)?

asked 2015-02-24 10:19:05 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Sometimes you don't need an optimal solution. A feasible solution is a must, but a decent value of the objective function will do. At least that's better than waiting forever...

Some backends (most?, all?) for the MixedIntegerLinearProgram support different stop criteria. But it took me quite some time to find them. How to tell MixedIntegerLinearProgram not to continue until the optimal solution is found?

PD: I found the answer (at least part of it) before I submitted this question, but I think it's good to ask the question for reference:

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-02-24 10:20:04 +0100

pang gravatar image

For the GLPK backend, you pass an extra, backend-specific parameter to the solver:

P = MixedIntegerLinearProgram(solver = "GLPK")
P.solver_parameter("timelimit", timelimit)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-02-24 10:19:05 +0100

Seen: 501 times

Last updated: Feb 24 '15