I am trying the following code with Python 2.7.12 and Numpy 1.11.0.
import numpy as np
from scipy.optimize import linprog
A = np.matrix([[1,0,0,1], [0, 1, 0 ,1], [0, 1, 1, 0]])
c = np.zeros(A.shape[1])
res = linprog(c,A_eq = A, b_eq = [0,1,-1], options=dict(bland=True))
print (res.x)
print (A.dot([0, 1, -2, 0]))
The output of the above is
nan
[[ 0 1 -1]]
So scipy.optimize.linprog does not find a solution even when one exists as evident by output of the dot multiplication of A_eq with [0, 1, -2, 0].
A similar question was asked here and I tried the solutions suggested there (i.e. adding options=dict(bland=True) or updating the tolerance value). I still get the same erroneous output as posted above. What could be the reason for this behaviour? Thank you.