DantzigPivot

As a part of CyLP.python.pivots it implements Dantzig’s Classical Simplex pivot rule. Although it already exists in CLP, for testing purposes we implement one in Python.

class CyLP.py.pivots.DantzigPivot.DantzigPivot(clpModel)[source]

Dantzig’s pivot rule implementation.

Usage

>>> from CyLP.cy import CyClpSimplex
>>> from CyLP.py.pivots import DantzigPivot
>>> from CyLP.py.pivots.DantzigPivot import getMpsExample
>>> # Get the path to a sample mps file
>>> f = getMpsExample()
>>> s = CyClpSimplex()
>>> s.readMps(f)  # Returns 0 if OK
0
>>> pivot = DantzigPivot(s)
>>> s.setPivotMethod(pivot)
>>> s.primal()
'optimal'
>>> round(s.objectiveValue, 5)
2520.57174

Previous topic

PivotPythonBase

Next topic

DualDantzigPivot

This Page