How would we formulate this as a linear program Announcements Assignments HW4 written Due Tue 212 10 pm P2 Optimization Released after lecture Due Thu 221 10 pm Midterm 1 Exam Mon 218 in class ID: 797556
Download The PPT/PDF document "Warm-up: Cryptarithmetic" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Warm-up: Cryptarithmetic
How would we formulate this as a linear program?
Slide2Announcements
Assignments:
HW4 (written)Due Tue 2/12, 10 pmP2: Optimization
Released after lectureDue Thu 2/21, 10 pmMidterm 1 ExamMon 2/18, in class
Recitation Fri is a review session
Practice midterm coming soon!
Slide3AI: Representation and Problem Solving
Integer Programming
Instructors: Pat Virtue & Stephanie Rosenthal
Slide credits: CMU AI, http://ai.berkeley.edu
Slide4Linear Programming: What to eat?
We are trying healthy by finding the optimal amount of food to purchase.
We can choose the amount of stir-fry (ounce) and boba (fluid ounces).
Healthy Squad Goals
2000
Calories
2500
Sugar
100 g
Calcium
700 mg
Food
CostCaloriesSugarCalciumStir-fry (per oz)1100320Boba (per fl oz)0.550470
What is the cheapest way to stay “healthy” with this menu?
How much
stir-fry
(ounce) and
boba
(fluid ounces) should we buy?
Slide5Optimization Formulation
Diet Problem
s.t.
Limit
Cost
Calorie min
Calorie max
Sugar
Calcium
Stir-fry
Boba
Slide6Slide7Representation & Problem Solving
s.t.
Problem Description
Graphical Representation
Optimization Representation
Slide8Cost Contours
Given the cost vector
where will
= 0 ?
Cost Contours
Given the cost vector
where will
= 0 ?
= 1 ?
= 2 ?
= -1 ?
= -2 ?
Piazza Poll 1
As the magnitude of
increases, the distance between
the contours lines of the objective
:
Increases
Decreases
Slide11Piazza Poll 1
As the magnitude of
increases, the distance between
the contours lines of the objective
:
Increases
Decreases
Slide12Solving a Linear Program
Inequality form, with no constraints
Slide13Solving a Linear Program
s.t.
Inequality form, with no constraints
Slide14Piazza Poll 2
s.t.
True or False: An minimizing LP with exactly on constraint, will always have a minimum objective at
.
Piazza Poll 2
s.t.
True or False: An minimizing LP with exactly on constraint, will always have a minimum objective at
.
Solving an LP
Solutions are at feasible intersections
of constraint boundaries!!Algorithms
Check objective at all feasible intersections
Slide17Solving an LP
But, how do we find the intersection between boundaries?
s.t.
Calorie min
Calorie max
Sugar
Calcium
Slide18Solving an LP
Solutions are at feasible intersections
of constraint boundaries!!Algorithms
Check objective at all feasible intersectionsSimplex
Slide19Solving an LP
Solutions are at feasible intersections
of constraint boundaries!!
Algorithms
Check objective at all feasible intersections
Simplex
Interior Point
Figure 11.2 from Boyd and
Vandenberghe
,
Convex Optimization
Slide20What about higher dimensions?
s.t.
Problem Description
Graphical Representation
Optimization Representation
Slide21“Marty, your not thinking fourth-dimensionally”
Slide22Shapes in higher dimensions
How do these linear shapes extend to 3-D, N-D?
What are intersections in higher dimensions?
How do these linear shapes extend to 3-D, N-D?
s.t.
Calorie min
Calorie max
Sugar
Calcium
Slide24How do we find intersections in higher dimensions?
s.t.
Calorie min
Calorie max
Sugar
Calcium
Still looking at subsets of
matrix
Linear Programming
We are trying healthy by finding the optimal amount of food to purchase.
We can choose the amount of stir-fry (ounce) and boba (fluid ounces).
Healthy Squad Goals
2000
Calories
2500
Sugar
100 g
Calcium
700 mg
Food
CostCaloriesSugarCalciumStir-fry (per oz)1100320Boba (per fl oz)0.550470
What is the cheapest way to stay “healthy” with this menu?
How much
stir-fry
(ounce) and
boba
(fluid ounces) should we buy?
Slide26Linear Programming
Integer Programming
We are trying healthy by finding the optimal amount of food to purchase.We can choose the amount of stir-fry (
bowls) and boba (glasses).
Healthy Squad Goals
2000
Calories
2500
Sugar
100 g
Calcium
700 mg
Food
CostCaloriesSugarCalciumStir-fry (per bowl)1100320Boba (per glass)
0.5
50
4
70
What is the cheapest way to stay “healthy” with this menu?
How much
stir-fry
(ounce) and boba
(fluid ounces) should we buy?
Slide27Linear Programming vs Integer Programming
Linear objective with linear constraints, but now with additional
constraint that all values in
must be integers
s.t.
We could also do:
Even more constrained: Binary Integer Programming
A hybrid: Mixed Integer Linear Programming
s.t.
Notation Alert!
Slide28Integer Programming: Graphical Representation
Just add a grid of integer points onto our LP representation
s.t.
Integer Programming: Cryptarithmetic
How would we formulate this as a
integer
program?
How would we could we solve it?
Slide30Relaxation
Relax IP to LP by dropping integer constraints
s.t.
Remember heuristics?
Slide31Piazza Poll 3:
Let
be the optimal objective of an integer program
.
Let
be an optimal point of an integer program
.
Let
be the optimal objective of the LP-relaxed version of
.
Let
be an optimal point of the LP-relaxed version of
.
Assume that is a minimization problem.Which of the following are true?
s.t.
s.t.
Piazza Poll 3:
Let
be the optimal objective of an integer program
.
Let
be an optimal point of an integer program
.
Let
be the optimal objective of the LP-relaxed version of
.
Let
be an optimal point of the LP-relaxed version of
.
Assume that is a minimization problem.Which of the following are true?
s.t.
s.t.
Piazza Poll 4:
True/False: It is sufficient to consider the integer points around the corresponding LP solution.
Slide34Piazza Poll 4:
True/False: It is sufficient to consider the integer points around the corresponding LP solution.
Slide35Solving an IP
Branch and Bound algorithm
Start with LP-relaxed version of IP
If solution
has non-integer value at
,
Consider two branches with two different slightly more constrained LP problems:
Left branch
: Add constraint
Right branch
: Add constraint
Recursion. Stop going deeper:When the LP returns a worse objective than the best feasible IP objective you have seen before (remember pruning!)When you hit an integer result from the LP
When LP is infeasible
Branch and Bound Example
10
15
20
25
5
10
15
Slide37Branch and Bound Example
10
15
20
25
5
10
15
10
15
20
25
5
10
15
10
15
20
25
5
10
15