Opened 9 years ago

Last modified 6 years ago

## #14540 closed defect

# MILP constraints are silently misunderstood — at Initial Version

Reported by: | ncohen | Owned by: | ncohen |
---|---|---|---|

Priority: | major | Milestone: | sage-7.2 |

Component: | linear programming | Keywords: | |

Cc: | vbraun, dimpase, mkoeppe, vdelecroix, tscrim | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

sage: p = MixedIntegerLinearProgram() sage: b = p.new_variable() sage: p.add_constraint(int(1) <= b[0] + b[1] + b[2] <= int(2)) sage: p.show() Maximization: Constraints: x_0 + x_1 + x_2 <= 2.0 Variables: x_0 is a continuous variable (min=0.0, max=+oo) x_1 is a continuous variable (min=0.0, max=+oo) x_2 is a continuous variable (min=0.0, max=+oo)

The code above works on the command-line. In a script, you can do without the `int()`

.

Nathann

**Note:**See TracTickets for help on using tickets.