SciPy

scipy.optimize.linprog_verbose_callback

scipy.optimize.linprog_verbose_callback(xk, **kwargs)[source]

A sample callback function demonstrating the linprog callback interface. This callback produces detailed output to sys.stdout before each iteration and after the final iteration of the simplex algorithm.

Parameters:

xk : array_like

The current solution vector.

**kwargs : dict

A dictionary containing the following parameters:

tableau : array_like

The current tableau of the simplex algorithm. Its structure is defined in _solve_simplex.

phase : int

The current Phase of the simplex algorithm (1 or 2)

nit : int

The current iteration number.

pivot : tuple(int, int)

The index of the tableau selected as the next pivot, or nan if no pivot exists

basis : array(int)

A list of the current basic variables. Each element contains the name of a basic variable and its value.

complete : bool

True if the simplex algorithm has completed (and this is the final call to callback), otherwise False.