
This post was updated on .
Dear Rcommunity,
I hope this message finds you well.
I am trying to solve an optimization problem formulated as a Mixed Integer Program in which there are indicator functions in the objective function and in some constraints. To be more specific, consider the following optimization problem where x1 and x2 are the decision variables:
min{a1 * x1 + a2 * x2 + b1 * delta(x1) + b2 * delta(x2)}
subject to:
(Constr. 1) c1 * x1 + c2 * x2 <= q  d1 * delta(x1)  d2 * delta(x2),
(Constr. 2) x1 <= M1 * delta(x1),
(Constr. 3) x2 <= M2 * delta(x2),
(Constr. 4) x1 is a nonnegative integer, and
(Constr. 5) x2 is a nonnegative integer.
In this optimization problem:
a1, a2, b1, b2, c1, c2, d1, d2, and q are known constants,
M1 and M2 are known positive constants, and, for all i in {1, 2},
delta(xi) = 1 if xi > 0, whereas delta(xi) = 0 otherwise.
I tried to use lpSolveAPI package to solve the problem. However, I do not know how to incorporate indicator functions as arguments into the functions set.objfn, add.constraint, and set.bounds.
I was wondering if someone could tell me how to use Rsoftware to solve the aforementioned optimization problem, please.
Thanks a lot for your help and/or suggestions.
Best regards,
Rodrigo.
