Please see http://trac.sagemath.org/ticket/20461 Comments welcome.
On Thu, May 12, 2016 at 1:02 AM, Dima Pasechnik <dimp...@gmail.com> wrote: > Hi, > Matthias Koeppe did a lot of work on MILPs recently, in particular on > copying LPs, see e.g. > http://trac.sagemath.org/ticket/20414 > and the meta-ticket http://trac.sagemath.org/ticket/20302 > Not sure whether he reads this, I cc to him. > I presume you got one of these updates messing up your code. > Dima > > > > On Thursday, May 12, 2016 at 8:18:07 AM UTC+1, Martin R wrote: >> >> Hi there! >> >> I am having a severe problem with a program of mine that stopped working, >> very likely after upgrading to 7.2.beta5, but I'm afraid I don't know from >> which version. (I believe something after 7.1) >> >> The error I get is: >> >> ValueError: Variable MIPVariable of dimension 1 is a variable from a >> different problem >> >> What I want to do is: check whether a MILP has a solution, and if so, >> check whether it still has a solution if I add a further constraint. The >> MILP's take a very long time to solve. >> >> What I do and what worked until very recently is roughly: >> >> p = MixedIntegerLinearProgram(constraint_generation=True, >> solver="CPLEX") # solver="GLPK") # twice as long # >> assignment = p.new_variable(binary=True) >> >> p.add_constraint(... some relations in terms of assignment[box, >> colour] ... ) >> >> p.solve() >> >> for (box, colour) in large_list: >> p_new = copy(p) >> p_new.add_constraint(assignment[box, colour] == 0) >> try: >> p_new.solve() >> >> bang! >> >> What should I do? >> >> I don't have a minimal example exhibiting the error, but if absolutely >> needed, I'd try to create one. >> >> Many thanks, >> >> Martin -- Matthias Koeppe -- http://www.math.ucdavis.edu/~mkoeppe -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.