bundles / scipy 1.18.0 / scipy / optimize / _linprog_ip / _ip_hsd
function
scipy.optimize._linprog_ip:_ip_hsd
Signature
def _ip_hsd(A, b, c, c0, alpha0, beta, maxiter, disp, tol, sparse, lstsq, sym_pos, cholesky, pc, ip, permc_spec, callback, postsolve_args)Summary
Solve a linear programming problem in standard form:
Extended Summary
Minimize
c @ xSubject to
A @ x == b x >= 0
using the interior point method of [4].
Parameters
A: 2-D array2-D array such that
A @ x, gives the values of the equality constraints atx.b: 1-D array1-D array of values representing the RHS of each equality constraint (row) in
A(for standard form problem).c: 1-D arrayCoefficients of the linear objective function to be minimized (for standard form problem).
c0: floatConstant term in objective function due to fixed (and eliminated) variables. (Purely for display.)
alpha0: floatThe maximal step size for Mehrota's predictor-corrector search direction; see :math:`beta_3`of [4] Table 8.1
beta: floatThe desired reduction of the path parameter (see [6])
maxiter: intThe maximum number of iterations of the algorithm.
disp: boolSet to
Trueif indicators of optimization status are to be printed to the console each iteration.tol: floatTermination tolerance; see [4] Section 4.5.
sparse: boolSet to
Trueif the problem is to be treated as sparse. However, the inputsA_eqandA_ubshould nonetheless be provided as (dense) arrays rather than sparse matrices.lstsq: boolSet to
Trueif the problem is expected to be very poorly conditioned. This should always be left asFalseunless severe numerical difficulties are frequently encountered, and a better option would be to improve the formulation of the problem.sym_pos: boolLeave
Trueif the problem is expected to yield a well conditioned symmetric positive definite normal equation matrix (almost always).cholesky: boolSet to
Trueif the normal equations are to be solved by explicit Cholesky decomposition followed by explicit forward/backward substitution. This is typically faster for moderate, dense problems that are numerically well-behaved.pc: boolLeave
Trueif the predictor-corrector method of Mehrota is to be used. This is almost always (if not always) beneficial.ip: boolSet to
Trueif the improved initial point suggestion due to [4] Section 4.3 is desired. It's unclear whether this is beneficial.permc_spec: str (default = 'MMD_AT_PLUS_A')(Has effect only with
sparse = True,lstsq = False,sym_pos = True.) A matrix is factorized in each iteration of the algorithm. This option specifies how to permute the columns of the matrix for sparsity preservation. Acceptable values are:NATURAL: natural ordering.MMD_ATA: minimum degree ordering on the structure of A^T A.MMD_AT_PLUS_A: minimum degree ordering on the structure of A^T+A.COLAMD: approximate minimum degree column ordering.
This option can impact the convergence of the interior point algorithm; test different values to determine which performs best for your problem. For more information, refer to
scipy.sparse.linalg.splu.callback: callable, optionalIf a callback function is provided, it will be called within each iteration of the algorithm. The callback function must accept a single scipy.optimize.OptimizeResult consisting of the following fields:
x
Current solution vector
fun
Current value of the objective function
success
True only when an algorithm has completed successfully, so this is always False as the callback function is called only while the algorithm is still iterating.
slack
The values of the slack variables. Each slack variable corresponds to an inequality constraint. If the slack is zero, the corresponding constraint is active.
con
The (nominally zero) residuals of the equality constraints, that is,
b - A_eq @ xphase
The phase of the algorithm being executed. This is always 1 for the interior-point method because it has only one phase.
status
For revised simplex, this is always 0 because if a different status is detected, the algorithm terminates.
nit
The number of iterations performed.
message
A string descriptor of the exit status of the optimization.
postsolve_args: tupleData needed by _postsolve to convert the solution to the standard-form problem into the solution to the original problem.
Returns
x_hat: floatSolution vector (for standard form problem).
status: intAn integer representing the exit status of the optimization
0 : Optimization terminated successfully 1 : Iteration limit reached 2 : Problem appears to be infeasible 3 : Problem appears to be unbounded 4 : Serious numerical difficulties encountered
message: strA string descriptor of the exit status of the optimization.
iteration: intThe number of iterations taken to solve the problem
Aliases
scipy.optimize._linprog_ip._ip_hsd