Search code examples
optimizationlinear-programmingconvex-optimizationmixed-integer-programming

Converting Conditional Statements Into Linear Constraints


I am trying to convert the 3rd condition below to a linear constraint. I have included the full problem and my progress for illustrative purposes.

An manufacturer is considering manufacturing three products a, b, c. The materials, labor, and profit for each product is as follows.

product: (qty of input material, labor hours, profit)

a: (3,6,200)

b: (6,5,300)

c: (10,8,400)

Currently, 12,000 units of input material and 12,000 hours of labor are available. The following additional restrictions are specified.

  1. If the company decides to produce "a" then it must produce at least 100 units.

  2. If the company decides to produce "b" cars then it must produce at least 80 units.

  3. If the company decides to produce "c" then it can produce at most a total of 120 units of "a" and "b" (which I interpret as a + b <= 120 if "c" is produced, and a + b subject to materials and labor constraints otherwise).

I need to formulate an integer linear program to maximize the companies profits, while satisfying labor and material limitations, and the 3 additional restriction listed above.

So far I have done the following.

I specify Xa, Xb, and Xc to be the quantities of a, b, and c produced. I introduce binary variables as follows:

Ya = 1 if Xa > 0, 0 otherwise.

Yb = 1 if Xb > 0, 0 otherwise.

Yc = 1 if Xc > 0, 0 otherwise.

The problem is then:

maximize 200Xa + 300Xb + 400Xc

s.t.

Xa >= 0, Xb >= 0, Xc >= 0

Ya in {0,1}, Yb in {0,1}, Yc in {0,1}

3Xa + 6Xb + 10Xc < = 12,000

6Xa + 5Xb + 8Xc < = 12,000

Xa >= 100Ya

Xb >= 80Yb

How do I formulate the last additional constraint?

Update:

After some more research. Xa + Xb <= 120 + M(1-Yc). Where M is large enough that Xa + Xb will not be artificially constrained beyond the materials and labor constraints. Leaving this up in case anyone else may be helped by it.


Solution

  • After some more research. Xa + Xb <= 120 + M(1-Yc). Where M >= 12000/5 - 120 = 2280.

    Additionally add:

    Ya + Yb + Yc <= 2

    Since the problem set-up restricts the production of Xa, Xb, and Xc simultaneously.