09.02.2015 Views

Sage Reference Manual: Numerical Optimization - Mirrors

Sage Reference Manual: Numerical Optimization - Mirrors

Sage Reference Manual: Numerical Optimization - Mirrors

SHOW MORE
SHOW LESS

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 />

EXAMPLE:<br />

sage: p = MixedIntegerLinearProgram()<br />

sage: v = p.new_variable()<br />

sage: p.set_objective(v[0] + v[1])<br />

sage: v.depth()<br />

1<br />

items()<br />

Returns the pairs (keys,value) contained in the dictionary.<br />

EXAMPLE:<br />

sage: p = MixedIntegerLinearProgram()<br />

sage: v = p.new_variable()<br />

sage: p.set_objective(v[0] + v[1])<br />

sage: v.items()<br />

[(0, x_0), (1, x_1)]<br />

keys()<br />

Returns the keys already defined in the dictionary.<br />

EXAMPLE:<br />

sage: p = MixedIntegerLinearProgram()<br />

sage: v = p.new_variable()<br />

sage: p.set_objective(v[0] + v[1])<br />

sage: v.keys()<br />

[0, 1]<br />

values()<br />

Returns the symbolic variables associated to the current dictionary.<br />

EXAMPLE:<br />

sage: p = MixedIntegerLinearProgram()<br />

sage: v = p.new_variable()<br />

sage: p.set_objective(v[0] + v[1])<br />

sage: v.values()<br />

[x_0, x_1]<br />

class sage.numerical.mip.MixedIntegerLinearProgram<br />

Bases: sage.structure.sage_object.<strong>Sage</strong>Object<br />

The MixedIntegerLinearProgram class is the link between <strong>Sage</strong>, linear programming (LP) and mixed<br />

integer programming (MIP) solvers.<br />

See the Wikipedia article on linear programming for further information on linear programming and the documentation<br />

of the MILP module for its use in <strong>Sage</strong>.<br />

A mixed integer program consists of variables, linear constraints on these variables, and an objective<br />

function which is to be maximised or minimised under these constraints. An instance of<br />

MixedIntegerLinearProgram also requires the information on the direction of the optimization.<br />

INPUT:<br />

•solver – the following solvers should be available through this class:<br />

–GLPK (solver="GLPK"). See the GLPK web site.<br />

–COIN Branch and Cut (solver="Coin"). See the COIN-OR web site.<br />

–CPLEX (solver="CPLEX"). See the CPLEX web site.<br />

12 Chapter 2. Mixed integer linear programming

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!