0

This is my first question on Stack Overflow.

I'm working on a optimization problem with R and the package lpSolveAPI which, to this point, works perfectly well for me.

My problem is very simple: How do I add a decision variable to the right hand side of a constraint?

Let C1,C2,...,C50 be the decision variables. How do I formulate a constraint like C1 > C34?

This seems to be so easy, that I have the feeling that I'm missing the point somewhere, but every post I've read and every example I've seen works with constant numeric constraints like C1 > 1000.

I don't have much experience with LPs or MILPs, so maybe there is a clever way to reformulate the constraint so it works with a numeric value on the rhs?

An example constraint from my application looks like this: 10 C1 + 2 C11 <= 200 C51

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

right after posting this question, i've had an idea how to solve it and it is really easy as well:

10 C1 + 2 C11 <= 200 C51 ---> 10 C1 + 2 C11 -200 C51 <= 0

This way it fits into the solver API!