#12547: Single variable inequalities in MixedIntegerLinearProgram should set the
min and max automatically
-------------------------------------+-------------------------------------
Reporter: ppurka | Owner: ncohen
Type: defect | Status: closed
Priority: major | Milestone: sage-
Component: linear | duplicate/invalid/wontfix
programming | Resolution: wontfix
Keywords: | Merged in:
MixedIntegerLinearProgram | Reviewers: Nathann Cohen, Jeroen
Authors: | Demeyer
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: #12546 | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by jdemeyer:
Old description:
> 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 )
> }}}
New description:
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.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/12547#comment:12>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.