How it works...
cv2.solveLP accepts three arguments: a function's weights, a linear constraints matrix, and a NumPy array object to save results. Weights are represented with an (N,1) or (1,N) vector of float values. The length of this vector also means the number of optimized parameters. The linear constraints matrix is an (M, N+1) NumPy array, where the last column contains constant terms for each constraint and each row, except the last element, which contains coefficients for the corresponding parameters. The last argument is intended to store the solution if it exists.
In general, there are four possible outcomes for linear programming problems, they may have a single solution, many solutions (in some range), or no determined solutions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access