0

I have a 5-20 variables in my problems, and generally for 3-6 the allowable solution space is either continuous down to a minimum value or exactly zero. For example, in one problem the first variable (x0) can be either be between 250-1000 or it can be 0.

The minimization is on a complex, piecewise-linear/non-linear function f(x0,...,xn).

Is this possible to do in a single Docplex model/minimize call? If so, does Docplex behave well with these sort of holes in the solution space?

rhaskett
  • 1,864
  • 3
  • 29
  • 48

1 Answers1

2

This concept is called a "semi-continuous" or "semi-integer" variable. Looking at the documentation you will find functions semicontinuous_var, semicontinuous_var_dict, ... in the Model class. These functions will create variables with the properties you asked for:

x0 = model.semicontinuous_var(250, 1000, "x0")

Note that using a semi-continuous variable will implicitly turn your model into a MIP.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22
  • Looks like the solution, Thanks. Two questions. Does Semi-Continuous assume 0 as the odd point? My problem is already an MIQP would adding this change it to a different type? – rhaskett Nov 27 '19 at 19:32
  • yes, 0 is always the singular value for semi-continuous variables. Note that their lower bound must be strictly positive. – Philippe Couronne Nov 29 '19 at 16:11
  • As your problem is already Mixed Integer (from piecewise-linear functions) its type should not change. – Philippe Couronne Nov 29 '19 at 16:15