Opened 10 years ago

Last modified 10 years ago

#11606 closed enhancement

simplify constraints in linear programs — at Initial Version

Reported by: john_perry Owned by: ncohen
Priority: major Milestone: sage-5.0
Component: linear programming Keywords: sd32
Cc: ncohen Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

MixedIntegerLinearProgram? doesn't notice when it is given constraints that already exist in the program, or that are constant multiples. A simple example:

sage: lp = MixedIntegerLinearProgram()
sage: for each in xrange(10):
....:     lp.add_constraint(lp[0]-lp[1],min=1)
....:     
sage: lp.show()
Maximization:
 
Constraints:
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
  1.0 <= x_0 -x_1 
Variables:
  x_0 is a continuous variable (min=0.0, max=+oo)
  x_1 is a continuous variable (min=0.0, max=+oo)

Notice that the same constraint appears 10 different times.

Change History (0)

Note: See TracTickets for help on using tickets.