On Thursday, May 12, 2016 at 6:17:33 PM UTC+1, Martin R wrote:
>
>
> So, what is the proper way to do it?  As I wrote, it's not really an 
>>> option to solve the whole problem for each new constraint...
>>>
>>
>> add a constraint, and solve again?
>>
>> Yes, and then?  I don't think I can remove it again, can I?  
>

sage: p.remove_constraint?
Docstring:
   Removes a constraint from self.

 

> As I wrote, pseudo-code is as follows, and keep in mind that large_list 
> really is a large list...
>
>     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()
>
>

-- 
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.

Reply via email to