The problem’s simplex solver
Change or retrieve basis
A basis is defined by the statuses assigned to all variables and constraints; the possible statuses are
A basis is valid if the basis matrix is non-singular, which implies that the number of basic variables and constraints is equal to the total number of constraints.
| Parameters: |
|
|---|---|
| Returns: | a mapping of the basis statuses of all variables and constraints |
| Return type: | dict from Variable or Constraint to str |
| Raises: |
|
Todo
Add doctest
Note
After SimplexSolver.solve() has been run successfully, the basis is left in a valid state. So it is not necessary to run this method before, e.g., re-optimizating after only the objective has been changed.
Return the values of the constraints for the current solution
| Parameters: | dual (bool) – whether to return dual or primal values |
|---|---|
| Returns: | the nonzero values of the constraints for the current solution |
| Return type: | dict from Constraint to float |
| Raises TypeError: | |
| if dual is not bool | |
Todo
Add doctest
Change or retrieve the solver’s control parameters
| Parameters: |
|
|---|---|
| Raises ValueError: | |
if a non-existing control name is given |
|
Todo
Add doctest
Return the objective value for the current solution
| Returns: | the objective value for the current solution |
|---|---|
| Return type: | float |
Todo
Add doctest
Write a sensitivity analysis report to file in readable format
| Parameters: |
|
|---|---|
| Raises: |
|
Todo
Add doctest
Write the solution to a file in a readable format
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest
Read the solution from a file
| Parameters: | fname (str) – the name of the file to read from (written by SimplexSolver.write_solution()) |
|---|---|
| Raises RuntimeError: | |
| if there is an error reading the file | |
Todo
Add doctest
Solve the linear program
| Parameters: | exact (bool) – whether to use exact arithmetic or not (only if the meth control parameter is 'primal') |
|---|---|
| Returns: | solution status; see SimplexSolver.status() for details, or "obj_ll reached" or "obj_ul reached" in case that happens |
| Return type: | |
| Raises: |
|
Todo
Add doctest
Return the current solution status
| Parameters: | detailed (bool) – whether to give a detailed solution status |
|---|---|
| Returns: | the current solution status |
| Return type: | str or length-2 tuple of str |
Todo
Add doctest
Return a variable or constraint causing unboundedness
| Returns: | a variable or constraint causing unboundedness (if any) and the nature of the unboundedness, either 'primal' or 'dual' |
|---|---|
| Return type: | length-2 tuple of Variable or Constraint and str |
Todo
Add doctest
Return the values of the variables for the current solution
| Parameters: | dual (bool) – whether to return dual or primal values |
|---|---|
| Returns: | the nonzero values of the variables for the current solution |
| Return type: | dict from Variable to float |
| Raises TypeError: | |
| if dual is not bool | |
Todo
Add doctest
Write the solution to a file
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest
The problem’s interior point solver
Return the values of the constraints for the current solution
| Parameters: | dual (bool) – whether to return dual or primal values |
|---|---|
| Returns: | the nonzero values of the constraints for the current solution |
| Return type: | dict from Constraint to float |
| Raises TypeError: | |
| if dual is not bool | |
Todo
Add doctest
Change or retrieve the solver’s control parameters
| Parameters: |
|
|---|---|
| Raises ValueError: | |
if a non-existing control name is given |
|
Todo
Add doctest
Return the objective value for the current solution
| Returns: | the objective value for the current solution |
|---|---|
| Return type: | float |
Todo
Add doctest
Write the solution to a file in a readable format
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest
Read the solution from a file
| Parameters: | fname (str) – the name of the file to read from (written by IPointSolver.write_solution()) |
|---|---|
| Raises RuntimeError: | |
| if there is an error reading the file | |
Todo
Add doctest
Solve the linear program
| Returns: | solution status; see IPointSolver.status() for details |
|---|---|
| Return type: | |
| Raises: |
|
Todo
Add doctest
Return the current solution status
| Returns: | the current solution status, either 'undefined', 'optimal, 'infeasible', or 'no feasible' |
|---|---|
| Return type: | str |
Todo
Add doctest
Return the values of the variables for the current solution
| Parameters: | dual (bool) – whether to return dual or primal values |
|---|---|
| Returns: | the nonzero values of the variables for the current solution |
| Return type: | dict from Variable to float |
| Raises TypeError: | |
| if dual is not bool | |
Todo
Add doctest
Write the solution to a file
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest
The problem’s integer optimization solver
Return the values of the constraints for the current solution
| Returns: | the nonzero values of the constraints for the current solution |
|---|---|
| Return type: | dict from Constraint to float |
Todo
Add doctest
Change or retrieve the solver’s control parameters
| Parameters: |
|
|---|---|
| Raises ValueError: | |
if a non-existing control name is given |
|
Todo
Add doctest
Return the objective value for the current solution
| Returns: | the objective value for the current solution |
|---|---|
| Return type: | float |
Todo
Add doctest
Write the solution to a file in a readable format
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest
Read the solution from a file
| Parameters: | fname (str) – the name of the file to read from (written by IntOptSolver.write_solution()) |
|---|---|
| Raises RuntimeError: | |
| if there is an error reading the file | |
Todo
Add doctest
Solve the mixed-integer linear program
| Parameters: |
|
|---|---|
| Returns: | solution status; see IntOptSolver.status() for details |
| Return type: | |
| Raises: |
|
Todo
Add doctest
Return the current solution status
| Returns: | the current solution status, either 'undefined', 'optimal, 'no feasible', or 'feasible' |
|---|---|
| Return type: | str |
Todo
Add doctest
Return the values of the variables for the current solution
| Returns: | the nonzero values of the variables for the current solution |
|---|---|
| Return type: | dict from Variable to float or int |
| Raises ValueError: | |
| if a variable with 'integer' or 'binary' kind has a non-integer value | |
Todo
Add doctest
Write the solution to a file
| Parameters: | fname (str) – the name of the file to write to |
|---|---|
| Raises RuntimeError: | |
| if there is an error writing the file | |
Todo
Add doctest