You are on page 1of 32

DAO1704 Lecture 10

Discrete Optimization
The Lego Game Revisited

• We have seen fractional solutions for certain numbers of large and


small bricks.
• What if we insist that the numbers of chairs and tables to produce must
be whole numbers?

Scenario 1. Some decision variables have to be integers.


Transportation Problem Revisited

• What if there is a requirement that each retail outlet can only be


supplied by one plant?
• What if Outlet A and Outlet B cannot be supplied by the same plant?

Scenario 2. There is a need to make choice or consider some


logical constraints.
Computer Production Problem Revisited

Scenario 3. There is a need to convert some nonlinear


constraints into linear constraints.
Discrete Optimization
• Discrete Optimization is an optimization problem in which
some (or all) of the decision variables must be integer-valued

• Examples:
– Integer variables: Number of workers, cars, machines, etc.
– Binary variables: YES/NO decisions
– Mixed Integer Program (MIP): Some variables are integer-valued

• Why do we need discrete optimization?


– A very powerful modeling method!
– CPLEX reports that > 90% of their clients’ problems are MIP’s
– Various applications: Sudoku
Discrete Optimization
• Taxonomy

– Integer Optimization/Programming (IP): Linear


optimization with all the decision variables being integer valued

– Binary Optimization: Linear optimization with all the


decision variables being binary valued

– Mixed Integer Optimization/Programming (MIP):


Linear optimization with some of the decision variables being
integer or binary valued
KNAPSACK PROBLEM
Using Binary Constraints
• One of the most powerful modeling frameworks for
modeling “Yes/No” type of decisions
– Usually 1 denotes YES and 0 denotes NO

• Various use of binary variables


Case – Knapsack Problem
Example: Capital Budgeting Models
• $15,000 available to invest
• 7 investments to choose from
• Goal: Choose investments to maximize total NPV
Investment Cash required NPV
1 $5,000 $16,000

2 $2,500 $8,000

3 $3,500 $10,000

4 $6,000 $19,500

5 $7000 $22,000

6 $4,500 $12,000

7 $3,000 $7,500

*No partial investment is allowed for each choice


Example: Capital Budgeting Models
• Decision variables: x1, …, x7
– Binary: xj = 1 if investment j is chosen, and 0 otherwise
• Objective: Total return
• Constraints: Cash constraint, binary constraint

Investment Cash required NPV


1 $5,000 $16,000

2 $2,500 $8,000

3 $3,500 $10,000

4 $6,000 $19,500

5 $7000 $22,000

6 $4,500 $12,000

7 $3,000 $7,500
Example: Capital Budgeting Models
• Formulation:

Investment
1 $5,000 $16,000

2 $2,500 $8,000

3 $3,500 $10,000

4 $6,000 $19,500

5 $7000 $22,000

6 $4,500 $12,000

7 $3,000 $7,500
Example: Capital Budgeting Models
• Solution: Select investments 1, 2 and 5.

• Total NPV = $46,000

Cash
Investment NPV
required
1 $5,000 $16,000 1

2 $2,500 $8,000 1

3 $3,500 $10,000 0

4 $6,000 $19,500 0

5 $7000 $22,000 1

6 $4,500 $12,000 0

7 $3,000 $7,500 0
Formulation of the Knapsack Problem
• Knapsack problem:
– n: number of “treasures” to pick from
– b: the total weight (or volume) that the knapsack can hold
– aj: value of each treasure j
– cj: weight (or volume) of each treasure j
– xj: whether to choose treasure j
FORMULATING LOGICAL CONSTRAINTS
It is not so easy!

• In reality, there may be additional conditions to be


considered:
– At most two investments can be selected
– Investments 1 and 2 cannot be selected together
– Investment 5 can be selected only if Investment 7 is
selected.
–…
Common Uses of Binary Variables
• At most one event (among 3) can occur

• For two candidates, it is the same as an either-or (not both)


relationship
Common Uses of Binary Variables
• All or Nothing can occur

• How about all-or-nothing constraint for three events?


Common Uses of Binary Variables
• Conditional: If Event 1 occurs, then Event 2 must occur

• Note
– If Event 1 does not occur, event 2 may or may not occur
– If Event 2 occurs, event 1 may or may not occur
General Logical Framework
• Conditional: If Logical statement 1 is true, then Logical
statement 2 must be true.

Logical statement 1 Logical statement 2


(condition) (conclusion)

Cross validation must be done in order to make sure your


constraint is correct.
• Condition is true, then conclusion must be true
• Condition is false, then conclusion may or may not be
true
Example
• Given project X, Y, Z. If X and Y are selected, then Z must be selected.

X and Y selected Z is selected


Idea 1

X Y LHS Condition RHS Conclusio Check


n
1 1 2 True Undefined Undefined Fail
1 0 1 False 1 True Fail
0 1 1 False 1 True Fail
0 0 0 False 0, 1 Free Pass
Idea 2

X Y LHS Condition RHS Conclusio Check


n
1 1 1 True 1 True Pass
1 0 0.5 False 1 True Fail
0 1 0.5 False 1 True Fail
0 0 0 False 0, 1 Free Pass
Idea 3

X Y LHS Condition RHS Conclusio Check


n
1 1 1 True 1 True Pass
1 0 0 False 0, 1 Free Pass
0 1 0 False 0, 1 Free Pass
0 0 -1 False 0, 1 Free Pass
CONVERTING NONLINEAR EXPRESSION
Where to build a new plant?

• China
– Construction cost: $10m
– Capacity: 10000
– Unit cost: $5

• Singapore
– Construction cost: $15m
– Capacity: 13000
– Unit cost: $4.5

• Malaysia
– Construction cost: $6m
– Capacity: 11000
– Unit cost: $7
A Fixed Cost Function
• Example of a typical cost function:
Common Uses of Binary Variables
• Conditional Range: If Event y does not occur, then x=0. If
Event y occurs, then 0 ≤ x ≤ M.

• Variable y is an ON/OFF switch


• The range of variable x depends on the switch
– If OFF, x must be zero
– If ON, x can be anything in the given range 0 ≤ x ≤ M

• Example: The production flow will be zero if one decides to


Shut down a production plant
A Fixed Cost Revisited
• Cost of production consists of fixed and variable costs
– Variable cost is per unit cost
– Fixed cost is a lump sum cost incurred as long as anything
is produced

• Example of a typical cost function:


Textile Manufacturing at Great Threads
• Five products
• 4000 labour hours and 4500 square yards of cloth available in a given
week
• Machines are rented on weekly basis

Product

Shirts $1500 2 3.0 $35 $20 $15

Shorts $1200 1 2.5 $40 $10 $30

Pants $1600 6 4.0 $65 $25 $40

Skirts $1500 4 4.5 $70 $30 $40

Jackets $1600 8 5.5 $110 $35 $75

• Goal: Find the optimal production plan that maximizes weekly profit
Textile Manufacturing at Great Threads
• Decision variables:
– y1, …, y5: On/Off switches
– x1, …, x5: Quantities to produce

• Formulation 1:
Textile Manufacturing at Great Threads
• Formulation 2:

• How to choose M?
– Any sufficiently large number

You might also like