how to get extreme ray for unbounded lp? #4248
Unanswered
Miraclelucy
asked this question in
Linear Solver questions
Replies: 1 comment
-
Hi, You can get rays with the MathOpt API; for example with Glop: model = mathopt.Model(name='unbounded LP')
x = model.add_variable(name='x')
y = model.add_variable(name='y')
model.add_linear_constraint(x + y == 5)
model.maximize(x)
result = mathopt.solve(model, mathopt.SolverType.GLOP,
params=mathopt.SolveParameters(
presolve=mathopt.Emphasis.OFF,
scaling=mathopt.Emphasis.OFF,
lp_algorithm=mathopt.LPAlgorithm.PRIMAL_SIMPLEX))
assert result.termination.reason == mathopt.TerminationReason.UNBOUNDED
print(result.primal_rays) will print
Note though that getting rays requires setting properly the solver settings so that it produces them. For example with presolver and scaling enabled (which are by default) on Glop you don't get rays. Usually our unit tests show the proper settings to get rays, for example here for the test of Glop. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
so Has it been resolved?
Beta Was this translation helpful? Give feedback.
All reactions