Integer Programming
Integer Programming
IE 8030
Prof. Emily Tucker
Oct. 29, 2024
What’d we cover last time?
• Complementary slackness
– Example
• Sensitivity analysis
Today
• Integer programming
Project Deliverable 2
• Due Fri. Nov. 8th
• Draft formulation of one model
• Include sections for:
– Sets
– Parameters
– Model formulation
– Formulation description
• The formulation description should be a paragraph that briefly notes
what each constraint does. E.g., constraint set (4) limits …
Homework Plan
• Homework 5 released yesterday
– Due Nov. 8th
Optimal Solution to LP
Optimal Solution to IP
• Pre-reqs
– Math 214 is a prereq for IOE 310
– IOE 265 is a prereq for IOE 366
• Credit is not given for both EECS 280 and 283
• 300-level course requires 1.5x effort of 200-level one
Sets:
𝐶 200 ≔ Math 214, EECS 280, EECS 283, IOE 265
𝐶 300 ≔ IOE 310, IOE 373, IOE 366
Input parameters:
𝑒 Relative effort to take 300-level class
Variables:
Objective:
min 𝑥𝑐 + 1.5𝑥𝑐
𝑐∈𝐶 200 𝑐∈𝐶 300
Example: Course Selection
Course Math 214 EECS 280 EECS IOE 265 IOE 310 IOE 373 IOE 366
283
Math
IOE
EECS
• Constraints
– Meet departmental requirements
𝑥1 + 𝑥2 + 𝑥4 + 𝑥5 ≥ 2 (Math)
𝑥4 + 𝑥5 + 𝑥6 + 𝑥7 ≥ 3 (IOE)
𝑥2 + 𝑥3 + 𝑥6 ≥ 2 (EECS)
Example: Course Selection
Course Math 214 EECS 280 EECS IOE 265 IOE 310 IOE 373 IOE 366
283
Math
IOE
EECS
• Constraints
– Pre-reqs
𝑥1 ≥ 𝑥5 (Math 214 is prereq for IOE 310)
𝑥4 ≥ 𝑥7 (IOE 265 is a prereq for IOE 366)
– Can’t take both EECS 280 and 283
𝑥2 + 𝑥3 ≤ 1
– Binary
𝑥𝑐 ∈ 0,1 ∀𝑐 ∈ 𝐶
Example: Course Selection
min σ𝑐∈𝐶 200 𝑥𝑐 + σ𝑐∈𝐶 300 1.5𝑥𝑐
𝑥1 + 𝑥2 + 𝑥4 + 𝑥5 ≥ 2
𝑥4 + 𝑥5 + 𝑥6 + 𝑥7 ≥ 3
𝑥2 + 𝑥3 + 𝑥6 ≥ 2
𝑥1 ≥ 𝑥5 Could we model this
𝑥4 ≥ 𝑥7 using an LP?
𝑥2 + 𝑥3 ≤ 1
Nope!
𝑥𝑐 ∈ 0,1 ∀𝑐 ∈ 𝐶
Knapsack Problem
Knapsack Example
https://xkcd.com/287/
Knapsack Problem
• General idea
– You have a knapsack that you’re trying to fill up with the most
valuable items
• Each item has a weight and a value
Formulate this as an
integer program
Set:
𝐼 Appetizers
Parameters:
If items are equally
𝑐𝑖 Cost of appetizer 𝑖 ∈ 𝐼
enjoyed (equal benefit)
Decision variables
𝑥𝑖 Number of appetizer 𝑖 ∈ 𝐼 selected
Formulation
Optimal solution:
max 0
Subject to: 1 mixed fruit
σ𝑖∈𝐼 𝑐𝑖 𝑥𝑖 = 15.05 2 hot wings
1 sampler plate
𝑥𝑖 ≥ 0, integer ∀𝑖 ∈ 𝐼
Example: Knapsack Problem
Set:
𝐼 Appetizers
What if items have
Parameters:
𝑐𝑖 Cost of appetizer 𝑖 ∈ 𝐼 different benefits?
𝑣𝑖 Benefit of appetizer 𝑖 ∈ 𝐼
Decision variables
𝑥𝑖 Number of appetizer 𝑖 ∈ 𝐼 selected
Formulation
𝑥𝑖 ≥ 0, integer ∀𝑖 ∈ 𝐼
Logical Constraints
Logical Constraints with Binary Variables
𝒙𝒊 = 𝒎
We must pick exactly 𝑚 of them 𝒊=𝟏
𝒏
If-then constraints:
If x1 = 1 then x2 = 1 x1 ≤ 𝑥2
If x1 = 1 then x2 = 0 x1 ≤ 1 − 𝑥2
If x1 = 0 then x2 = 0 1 − 𝑥1 ≤ 1 − 𝑥2
Practice
• Binary variables: 𝑦1 and 𝑦2
• Decision variables
– 𝑦𝑖 if EMT station is built at location 𝑖 ∈ 𝐼
– 𝑥𝑖𝑗 if population center 𝑗 ∈ 𝐽 is assigned to station 𝑖 ∈ 𝐼
Disney World
Response time of 𝑗 =
Minimize average 1 σ𝑖∈𝐼 𝑐𝑖𝑗 𝑥𝑖𝑗
min 𝑐𝑖𝑗 𝑥𝑖𝑗
response time 𝐽
𝑗∈𝐽 𝑖∈𝐼