How to break the infeasibility of solution for the function linprog?

2 visualizaciones (últimos 30 días)
Hello everyone,
I'm working on some heuristic algorithm wich has to return to choose another random initial state and run again.
Inside I loop while I have to solve at each iteration a linear programming by using the functon linprog.
How can I break the programme and return it to the initial state choice when there is no feasible solution to the linear programming problem without stopping the whole program?.
Thank you.
  2 comentarios
Torsten
Torsten el 8 de En. de 2023
Can't you choose how to proceed depending on the linprog exitflag ?
Gustave X
Gustave X el 8 de En. de 2023
sorry but I'm a new user of matlab. However, I know that the error is because of infeasibility reason. I read this https://fr.mathworks.com/help/optim/ug/linprog.html#buusznx-exitflag
but I don't know how to implement it on the program.
Thank you in advance.

Iniciar sesión para comentar.

Respuesta aceptada

Torsten
Torsten el 8 de En. de 2023
Movida: Matt J el 8 de En. de 2023
[x,fval,exitflag,output] = linprog(___)
if exitflag > 0 % linprog was successful
take action 1
else % linprog was not successful
take action 2
end

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by