#12547: Single variable inequalities in MixedIntegerLinearProgram should set the
min and max automatically
----------------------------------+-----------------------------------------
Reporter: ppurka | Owner: ncohen
Type: defect | Status: new
Priority: major | Milestone: sage-5.0
Component: linear programming | Keywords: MixedIntegerLinearProgram
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies: 12546
----------------------------------+-----------------------------------------
Currently single variable inequalities in `MixedIntegerLinearProgram` are
more or less "ignored." So if one enters something like
{{{
sage: p = MixedIntegerLinearProgram()
sage: b = p.new_variable()
sage: p.add_constraint( -1 <= b[0] )
sage: p.add_constraint( b[0] <= 2 )
sage: p.show()
Maximization:
Constraints:
x_0 <= 2.0
Variables:
x_0 is a continuous variable (min=0.0, max=+oo)
}}}
As evident from the above code, the min and the max of the variable have
not been changed and so the lower bound on `b[0]` will be simply ignored
by the optimization.
The method `add_constraint` should automatically set the min and the max
if it detects that there is only one variable in the constraint.
This ticket also depends on a proper fix for #12546 so that constraints
can be added as
{{{
sage: p.add_constraint( -1 <= b[0] <= 2 )
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12547>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.