Simplex method routines

Problem.simplex(SimplexControls controls)

Solve LP problem with the simplex method

Problem.exact(SimplexControls controls)

Solve LP problem in exact arithmetic

Problem.get_status()

Retrieve generic status of basic solution

Problem.get_prim_stat()

Retrieve status of primal basic solution

Problem.get_dual_stat()

Retrieve status of dual basic solution

Problem.get_obj_val()

Retrieve objective value (basic solution)

Returns:the objective value of the basic solution
Return type:float
Problem.get_row_stat(row)

Retrieve row status

Parameters:row (int or str) – the index or name of the row
Returns:the row status, either 'basic', 'lower', 'upper', 'free', or 'fixed'
Return type:str
Problem.get_row_prim(row)

Retrieve row primal value (basic solution)

Parameters:row (int or str) – the index or name of the row
Returns:the solution value
Return type:float
Problem.get_row_dual(row)

Retrieve row dual value (basic solution)

Parameters:row (int or str) – the index or name of the row
Returns:the solution value
Return type:float
Problem.get_col_stat(col)

Retrieve column status

Parameters:col (int or str) – the index or name of the column
Returns:the column status, either 'basic', 'lower', 'upper', 'free', or 'fixed'
Return type:str
Problem.get_col_prim(col)

Retrieve column primal value (basic solution)

Parameters:col (int or str) – the index or name of the column
Returns:the solution value
Return type:float
Problem.get_col_dual(col)

retrieve column dual value (basic solution)

Parameters:col (int or str) – the index or name of the column
Returns:the solution value
Return type:float
Problem.get_unbnd_ray(names_preferred=False)

Determine variable causing unboundedness

Parameters:names_preferred (bool) – whether to return the row or column name or index

Simplex controls

class ecyglpki.SimplexControls

The simplex solver control parameter object

>>> r = SimplexControls()
it_lim

Iteration limit, an int

>>> r.it_lim  # the GLPK default
2147483647
>>> r.it_lim = 10
>>> r.it_lim
10
meth

The simplex method, a str

The possible values are

  • 'primal': two-phase primal simplex
  • 'dual': two-phase dual simplex
  • 'dual_fail_primal': two-phase dual simplex and, if it fails, switch to primal simplex
>>> r.meth  # the GLPK default
'primal'
>>> r.meth = 'dual_fail_primal'
>>> r.meth
'dual_fail_primal'
msg_lev

The message level, a str

The possible values are

  • 'no': no output
  • 'warnerror': warnings and errors only
  • 'normal': normal output
  • 'full': normal output and informational messages
>>> r.msg_lev  # the GLPK default
'full'
>>> r.msg_lev = 'no'
>>> r.msg_lev
'no'
obj_ll

Lower limit of the objective function, a Real number

(Used only if meth is 'dual'.)

>>> r.obj_ll  # the GLPK default
-1.7976931348623157e+308
>>> r.obj_ll = -1234.0
>>> r.obj_ll
-1234.0
obj_ul

Upper limit of the objective function, a Real number

(Used only if meth is 'dual'.)

>>> r.obj_ul  # the GLPK default
1.7976931348623157e+308
>>> r.obj_ul = 123.4
>>> r.obj_ul
123.4
out_dly

Output delay [ms] of solution process information, an int

>>> r.out_dly  # the GLPK default
0
>>> r.out_dly = 25
>>> r.out_dly
25
out_frq

Output frequency [ms] of informational messages, an int

>>> r.out_frq  # the GLPK default
5000
>>> r.out_frq = 500
>>> r.out_frq
500
presolve

Whether to use the LP presolver, a bool

>>> r.presolve  # the GLPK default
False
>>> r.presolve = True
>>> r.presolve
True
pricing

The pricing technique, a str

The possible values are

  • 'Dantzig': standard ‘textbook’
  • 'steepest': projected steepest edge
>>> r.pricing  # the GLPK default
'steepest'
>>> r.pricing = 'Dantzig'
>>> r.pricing
'Dantzig'
r_test

The ratio test technique, a str

The possible values are

  • 'standard': standard ‘textbook’
  • 'Harris': Harris’s two-pass ratio test
>>> r.r_test  # the GLPK default
'Harris'
>>> r.r_test = 'standard'
>>> r.r_test
'standard'
tm_lim

Time limit [ms], an int

>>> r.tm_lim  # the GLPK default
2147483647
>>> r.tm_lim = 1e7
>>> r.tm_lim
10000000
tol_bnd

Tolerance to check if the solution is primal feasible, a Real number

>>> r.tol_bnd  # the GLPK default
1e-07
>>> r.tol_bnd = 0.2
>>> r.tol_bnd
0.2
tol_dj

Tolerance to check if the solution is dual feasible, a Real number

>>> r.tol_dj  # the GLPK default
1e-07
>>> r.tol_dj = 0.01
>>> r.tol_dj
0.01
tol_piv

Tolerance to choose eligible pivotal elements, a Real number

>>> r.tol_piv  # the GLPK default
1e-09
>>> r.tol_piv = 1e-3
>>> r.tol_piv
0.001