On 2014-12-15, pegah Ali <pegah.aliza...@gmail.com> wrote: > ------=_Part_3151_822295702.1418661065675 > Content-Type: multipart/alternative; > boundary="----=_Part_3152_1266595069.1418661065675" > > ------=_Part_3152_1266595069.1418661065675 > Content-Type: text/plain; charset=UTF-8 > > Hello Everybody, > > Is there anyway to check is a linear program which has been implemented by > MixedIntegerLinearprogram > has a solution or not. and also can I verify why it doesn't have any > solution, it might be because of any reasons : > "the model is infeasible", "the model is unbounded" and so on. > > For instance I have a function which makes an LP based on the given > variable, I wish to verify is the LP has any solution. > > def find_solution(variable): > lp = my MixedIntegerLinearProgram > lp.solve() > output = lp has solution or not > return output >
if your LP has all variables continuous, then basically you want to produce a Farkas certificate of infeasibilty. Most LP solvers (but not GLPK) can do this. In the LP language, you need to compute the dual of it, and check that it has unbounded optimum. I have some Sage code for this that I wanted at some point to include into Sage, but never got around to. I can dig it up. Dima -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.