294. Non-Linear Programming

294.0.0.1. EOQ

Parameters

Decision Variable

Objective

Minimize annual total cost

Objective Function

min𝑞0𝐾𝐷𝑞OrderingCost+𝑝𝐷PurchasingCost+𝑞2InventoryCost

𝑝𝐷 is just a constant, so:

𝑇𝐶(𝑞)=𝐾𝐷𝑞OrderingCost+𝑞2InventoryCost
294.0.0.2. Portfolio Optimization

Objective

Invest 𝐵 dollars in 𝑛 stocks while managing risk and meeting required return

Notation

Model

min𝑖=1𝑛𝜎𝑖2𝑥𝑖2+2𝑖=1𝑛𝑗=𝑖+1𝑛𝜎𝑖𝑗𝑥𝑖𝑥𝑗(Total risk)𝑠.𝑡.𝑖=1𝑛𝑝𝑖𝑥𝑖𝐵(Budget constraint)𝑖=1𝑛𝜇𝑖𝑥𝑖𝑅(Return constraint)𝑥𝑖0𝑖=1,,𝑛(No short-selling)

294.0.1. Linearizing Maximum/Minimum Functions

  1. When the maximum function is on the smaller side of inequality

General Form

𝑦max(𝑥1,𝑥2)𝑦𝑥1𝑦𝑥2

Generalized form with more than two elements

𝑦max(𝑥1,𝑥2,,𝑥𝑛)𝑦𝑥𝑖𝑖=1,,𝑛

Example

𝑦+𝑥1+3max(𝑥1𝑥3,2𝑥2+4){𝑦+𝑥1+3𝑥1𝑥3𝑦+𝑥1+32𝑥2+4
  1. When the minimum function is on the larger side of inequality

General Form

𝑦min(𝑥1,𝑥2)𝑦𝑥1𝑦𝑥2

Generalized form with more than two elements

𝑦min(𝑥1,𝑥2,,𝑥𝑛)𝑦𝑥𝑖𝑖=1,,𝑛

Example

𝑦+𝑥1min(𝑥1𝑥3,2𝑥2+4,0){𝑦+𝑥1𝑥1𝑥3𝑦+𝑥12𝑥2+4𝑦+𝑥10

Cases Where Linearization Does Not Apply

𝑦=max(𝑥1,𝑥2)or𝑦=min(𝑥1,𝑥2)

294.0.2. Linearize Objective Function

  1. Minimize a Maximum Function
minmax(𝑥1,𝑥2)min𝑤𝑠.𝑡.𝑤𝑥1𝑤𝑥2
  1. Maximize a Minimum Function
maxmin(𝑥1,𝑥2,2𝑥3+5)+𝑥4𝑠.𝑡.2𝑥1+𝑥2𝑥4𝑥3max𝑤+𝑥4𝑠.𝑡.𝑤𝑥1𝑤𝑥2𝑤2𝑥3+52𝑥1+𝑥2𝑥4𝑥3

Cases Where Linearization Does Not Apply

Absolute Function

The absolute value is equivalent to a maximum function:

|𝑥|=max(𝑥,𝑥)

Thus, it can be linearized when it appears on the smaller side of an inequality:

|𝑥|𝑦{𝑥𝑦𝑥𝑦
Example

We want to allocate $1000 to 2 people in a fair way

  • Fairness criterion: Minimize the difference between the amounts each person receives.

  • Let 𝑥𝑖 be amount to allocate to person 𝑖 for 𝑖=1,2

We write the problem as:

min|𝑥2𝑥1|𝑠.𝑡.𝑥1+𝑥2=1000𝑥𝑖0𝑖=1,2
  • The absolute value makes the objective nonlinear

Linearizing the Problem

We now reformulate the problem to make it linear

Step 1.: Introduce a new variable

Let 𝑤 be the absolute difference: 𝑤=|𝑥2𝑥1|

min𝑤𝑠.𝑡.𝑥1+𝑥2=1000𝑤=|𝑥2𝑥1|𝑥𝑖0𝑖=1,2

Step 2. Relax the equality

We replace the equality with an inequality:

min𝑤𝑠.𝑡.𝑥1+𝑥2=1000𝑤|𝑥2𝑥1|𝑥𝑖0𝑖=1,2

Step 3. Replace absolute value with maximum

Recall:

|𝑥2𝑥1|=max(𝑥2𝑥1,𝑥1𝑥2)

Therefore:

𝑤|𝑥2𝑥1|𝑤max(𝑥2𝑥1,𝑥1𝑥2)𝑤𝑥2𝑥1𝑤𝑥1𝑥2

Now the problem is fully linear:

min𝑤𝑠.𝑡.𝑥1+𝑥2=1000𝑤𝑥2𝑥1𝑤𝑥1𝑥2𝑥𝑖0𝑖=1,2

Reformulating in One Variable

using 𝑥2=1000𝑥1, we can express everything in terms of 𝑥1:

min𝑤𝑠.𝑡.𝑤10002𝑥1𝑤2𝑥11000𝑥10

We are minimizing 𝑤, which represents the difference between the two allocations. The solution occurs when the two inequalities intersect — that is, when both are equal:

10002𝑥1=2𝑥11000𝑥1=500

So:

  • 𝑥1=500
  • 𝑥2=1000𝑥1=500
  • 𝑤=|500500|=0

This is the fair allocation: each person receives $500, and the difference between the two amounts is 0.

294.0.3. Linearizing Products of Decision Variables

Products of decision variables can be linearized if:

Cannot be linearized if: