Hi Faizan,
I don't understand. Do you mean that the problem is actually feasible but ill conditioned so that linprog finds the solution but other solvers interfaced with cvxpy don't? If that's the case I'd suggest to try to use CPLEX from cvxpy; it is very robust.
Otherwise, if what you mean is to try to find a solution that is "as close" to the feasible set as possible, then you have to relax the constraints.
Suppose the feasible set is expressed as: A @ x <= b and x >= 0. Let the objective be: c.T @ x. Then, the standard LP would be:
x = cvx.Variable((len_x, 1), nonneg=True)
constraints = [A@ x <= b]
problem = cvx.Problem(cvx.Minimize(c.T @ x), constraints)
If this problem is mathematically infeasible (meaning the constraints A@ x <= b and x>= 0 are mutually exclusive, and not a matter of robustness of the solver), then you could do the following. Suppose you are willing to relax the constraints A@ x <= b, but you really want to enforce that x remains nonnegative. Then, you can add epsilon as a slack variable:
x = cvx.Variable((len_x, 1), nonneg=True)
epsilon = cvx.Variable((len_b, 1), nonneg=True)
constraints = [A@ x + <= b + epsilon]
problem = cvx.Problem(cvx.Minimize(c.T @ x + cvx.sum(epsilon)), constraints)
Hope that helps.
Best,
Sergio