Question

Is there an api to solve the feasibility problem (whether a feasible point exists) for a set of convex restraints in CPLEX.

Was it helpful?

Solution

Yes, just don't enter an objective function. cplex will give you any solution it can find or prove that there isn't a solution.

var x;
var y;
minimize 1;

subject to con1:
  x + y <= 6;
  x + y >= 7;

OTHER TIPS

You can simply add slack to all constraints, and put only the slack variables in the cost function with cost 1. Then test if Cplex finds a solution with cost 0.

A simple way is that you add an empty objective function. for instance, if you use concert for .net, using AddMinimize() or AddMaximize() without any input param will do the job. You can also populate as many feasible solutions as you want by using Populate() method.

Aslo, you mentioned convex constraint. I think cplex can handle functions like log, but I think some convex function is in some freaking form and I am not sure whether you can express them as an expression in cplex model.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top