Sage Reference Manual: Numerical Optimization - Mirrors
Sage Reference Manual: Numerical Optimization - Mirrors
Sage Reference Manual: Numerical Optimization - Mirrors
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Numerical</strong> <strong>Optimization</strong>, Release 6.1.1<br />
sage: p = MixedIntegerLinearProgram()<br />
sage: v = p.new_variable()<br />
sage: p.set_objective(v[1])<br />
sage: p.get_min(v[1])<br />
0.0<br />
sage: p.set_min(v[1],6)<br />
sage: p.get_min(v[1])<br />
6.0<br />
sage: p.set_min(v[1], None)<br />
sage: p.get_min(v[1])<br />
set_objective(obj)<br />
Sets the objective of the MixedIntegerLinearProgram.<br />
INPUT:<br />
•obj – A linear function to be optimized. ( can also be set to None or 0 when just looking for a<br />
feasible solution )<br />
EXAMPLE:<br />
Let’s solve the following linear program:<br />
Maximize:<br />
x + 5 * y<br />
Constraints:<br />
x + 0.2 y