开发者

feasiblity problem in CPLEX

开发者 https://www.devze.com 2023-04-06 14:02 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号