How to check for infeasible solution to linprog?

7 次查看(过去 30 天)
Hi,
I'm using linprog to try and program a branch-and-bound algorithm. In order for it to work properly, I need to check if the solution is infeasible, and react appropriately. Otherwise, MATLAB only outputs the following error message:
Exiting: One or more of the residuals, duality gap, or total relative error
has grown 100000 times greater than its minimum value so far:
the primal appears to be infeasible (and the dual unbounded).
(The dual residual < TolFun=1.00e-08.)
and proceeds as if the solution were feasible.
Does anyone know how to check for infeasible solutions to linprog?
Thanks,
Mike

采纳的回答

Matt J
Matt J 2013-5-30
编辑:Matt J 2013-5-30
The exitflag output argument will return -2, -3, or -5 if infeasibility was detected
[x,fval,exitflag] = linprog(...)
See the doc for a full table of exitflag behavior

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by