/
Warm-up: Cryptarithmetic Warm-up: Cryptarithmetic

Warm-up: Cryptarithmetic - PowerPoint Presentation

acenum
acenum . @acenum
Follow
347 views
Uploaded On 2020-08-04

Warm-up: Cryptarithmetic - PPT Presentation

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

objective integer programming linear integer objective linear programming optimal fry solving constraint representation poll program piazza calorie boba stir

Share:

Link:

Embed:

Download Presentation from below link

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.


Presentation Transcript

Slide1

Warm-up: Cryptarithmetic

How would we formulate this as a linear program?

Slide2

Announcements

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!

Slide3

AI: Representation and Problem Solving

Integer Programming

Instructors: Pat Virtue & Stephanie Rosenthal

Slide credits: CMU AI, http://ai.berkeley.edu

Slide4

Linear 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?

Slide5

Optimization Formulation

Diet Problem

s.t.

 

Limit

 

 

 

Cost

Calorie min

Calorie max

Sugar

Calcium

Stir-fry

Boba

Slide6

Slide7

Representation & Problem Solving

s.t.

 

Problem Description

Graphical Representation

Optimization Representation

Slide8

Cost Contours

Given the cost vector

where will

= 0 ?

 

Slide9

Cost Contours

Given the cost vector

where will

= 0 ?

= 1 ?

= 2 ?

= -1 ?

= -2 ?

 

Slide10

Piazza Poll 1

As the magnitude of

increases, the distance between

the contours lines of the objective

:

 

Increases

Decreases

Slide11

Piazza Poll 1

As the magnitude of

increases, the distance between

the contours lines of the objective

:

 

Increases

Decreases

Slide12

Solving a Linear Program

 

Inequality form, with no constraints

Slide13

Solving a Linear Program

s.t.

 

Inequality form, with no constraints

Slide14

Piazza Poll 2

s.t.

 

True or False: An minimizing LP with exactly on constraint, will always have a minimum objective at

.

 

Slide15

Piazza Poll 2

s.t.

 

True or False: An minimizing LP with exactly on constraint, will always have a minimum objective at

.

 

Slide16

Solving an LP

Solutions are at feasible intersections

of constraint boundaries!!Algorithms

Check objective at all feasible intersections

Slide17

Solving an LP

But, how do we find the intersection between boundaries?

s.t.

 

 

 

Calorie min

Calorie max

Sugar

Calcium

Slide18

Solving an LP

Solutions are at feasible intersections

of constraint boundaries!!Algorithms

Check objective at all feasible intersectionsSimplex

Slide19

Solving 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

Slide20

What about higher dimensions?

s.t.

 

Problem Description

Graphical Representation

Optimization Representation

Slide21

“Marty, your not thinking fourth-dimensionally”

Slide22

Shapes in higher dimensions

How do these linear shapes extend to 3-D, N-D?

 

 

 

Slide23

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

Slide24

How do we find intersections in higher dimensions?

s.t.

 

 

 

Calorie min

Calorie max

Sugar

Calcium

Still looking at subsets of

matrix

 

Slide25

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?

Slide26

Linear 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?

Slide27

Linear 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!

Slide28

Integer Programming: Graphical Representation

Just add a grid of integer points onto our LP representation

s.t.

 

Slide29

Integer Programming: Cryptarithmetic

How would we formulate this as a

integer

program?

How would we could we solve it?

Slide30

Relaxation

Relax IP to LP by dropping integer constraints

s.t.

 

Remember heuristics?

Slide31

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.

 

Slide32

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.

 

Slide33

Piazza Poll 4:

True/False: It is sufficient to consider the integer points around the corresponding LP solution.

Slide34

Piazza Poll 4:

True/False: It is sufficient to consider the integer points around the corresponding LP solution.

Slide35

Solving 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

 

Slide36

Branch and Bound Example

10

15

20

25

5

10

15

Slide37

Branch and Bound Example

10

15

20

25

5

10

15

10

15

20

25

5

10

15

10

15

20

25

5

10

15