I have a large system of linear inequalities I am trying to solve for in python, ideally with non-negative integers.
I have a matrix A of size (1000*700) and matrix b of size (700) where each line in the system is set up such that A*C <= b. I am trying to solve for C. Multiple solutions online involve Scipy optimization module, however this requires an optimization function. Trying to put all 0's for the coefficients in the optimization function and inputting the constraints as the system of inequalities gives me a solution which is wrong. I have put down a part of my code below.
from scipy.optimize import linprog
coefficients_min_y = [0] * len(A[0])
res = linprog(coefficients_min_y, A_ub=A, b_ub=b, bounds=(0, None))
if res.success:
coefficients = res.x
else:
print("Solution is infeasible")
matrixMult = np.dot(A, coefficients)
Given that linprog outputs a feasible solution, I use matrixMult to check if the solution satisfies the conditions. However it is not solving correctly. Is this because of the optimization function or am I doing something else wrong.