2

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

I J
  • 805
  • 3
  • 9
  • 19

3 Answers3

2

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;
vitaut
  • 49,672
  • 25
  • 199
  • 336
David Nehme
  • 21,379
  • 8
  • 78
  • 117
  • Didnt know cplex would accept a constant as objective function. I was working by minimizing ||x||^2. Thanks – I J Sep 21 '11 at 01:00
  • When you use a constant in the objective function, Cplex will use a formulation with slack variables very similar to the one I suggest in my answer. Advantage of explicitly adding the slack variables yourself is that it typically gives you some idea which constraints are contradicting each other when the problem turns out to be infeasible. – willem Jan 26 '12 at 12:01
1

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.

willem
  • 2,617
  • 5
  • 26
  • 38
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.

jc W
  • 99
  • 1
  • 7