Search code examples
optimizationlinear-programminginteger-programming

In an ILP problem, is it possible to constrain/penalize the number of decision variables used?


I'm trying to setup minimization problems with restrictions on the number of decision variables used.

Is it possible to do this within a linear programming framework? Or am I forced to use a more sophisticated optimization framework?

Suppose all x's are non-negative integers:

x1, x2, x3, x4, x5 >= 0

1) Constraint: Is it possible to set up the problem so that no more than 3 of the x's can be non-zero? e.g. if

x1 = 1, x2 = 2, x3 = 3 then x4 = 0 and x5 = 0 

2) Penalty: Suppose there are 3 possible solutions to the problem:

a) x1 = 1, x2 = 2, x3 = 3, x4 = 0, x5 = 0
b) x1 = 2, x2 = 3, x3 = 0, x4 = 0, x5 = 0
c) x1 = 3, x2 = 0, x3 = 0, x4 = 0, x5 = 0

Due to simplicity, solution (c) is preferred over solution (b) which is preferred over solution (a) i.e. 'using' less decision variables is preferable.

In both questions I've simplified the problem down to 5 x's, but in reality I have 100's of x's to optimise over.

I can see how I might do this in a general optimisation framework using indicator/delta variables, but can't figure out how to do it in linear programming. Any help would be appreciated!


Solution

  • You can build your own indicators (and without restrictions to some very specific problem you also need to).

    Assuming there is an upper-bound ub_i for all of your integer-variables x0, x1, ..., xn, introduce binary-variables u0, u1, ... un and post new constraints like:

    u1 * ub_1 >= x1
    u2 * ub_2 >= x2
    ...
    

    (the ub_x constants are often called big-M constants; but we keep them as small as possible for better relaxations)

    Then your cardinality-constraint is simply:

    sum(u) <= 3
    

    Of course you can also use those u-variables in whatever penalty-design you might want to use.