feasiblity problem in CPLEX
Is there an api to solve the feasibility problem (whether a feasible point exists) for a set o开发者_Go百科f convex restraints in CPLEX.
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;
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.
精彩评论