Linear Programming (Optimization)

Download Report

Transcript Linear Programming (Optimization)

Chapter 1. Formulations
1
 Mixed Integer Optimization Problem (or (Linear) Mixed Integer Program,
MIP)
min 𝑐 β€² π‘₯ + 𝑑 β€² 𝑦
𝐴π‘₯ + 𝐡𝑦 = 𝑏 (or 𝐴π‘₯ + 𝐡𝑦 ≀ 𝑏)
π‘₯ ∈ 𝑍+𝑛 , 𝑦 ∈ 𝑅+π‘˜ ,
where 𝐴 ∈ 𝑍 π‘š×𝑛 , 𝐡 ∈ 𝑍 π‘š×π‘˜ , 𝑏 ∈ 𝑍 π‘š , 𝑐 ∈ 𝑍 𝑛 , 𝑑 ∈ 𝑍 π‘˜
 Integer Optimization Problem (IP)
min 𝑐 β€² π‘₯
𝐴π‘₯ = 𝑏
π‘₯ ∈ 𝑍+𝑛
 Binary (or zero-one) Integer Optimization Problem (BIP)
min 𝑐 β€² π‘₯
𝐴π‘₯ = 𝑏
π‘₯ ∈ 0, 1
Integer Programming 2013
𝑛
( or π‘₯ ∈ 𝐡𝑛 )
2
 Combinatorial Optimization Problem
Given a finite set 𝑁 = 1, … , 𝑛 , weights 𝑐𝑗 for each 𝑗 ∈ 𝑁, and a set 𝐹 of
feasible subsets of 𝑁.
Want to find a minimum (or maximum) weight feasible subset in 𝐹.
(COP)
min
π‘†βŠ†π‘
π‘—βˆˆπ‘† 𝑐𝑗
:𝑆 ∈ 𝐹
 Almost all COPs can be formulated as IP or BIP
οƒ˜Knapsack problem, Traveling Salesman Problem, Min/Max cut of graph, Stable
set, Steiner Tree, …
Integer Programming 2013
3
Applications
 Numerous applications
οƒ˜Transportation (train scheduling)
οƒ˜Airline crew scheduling, plane scheduling
οƒ˜Production planning, distribution, SCM, logistics
οƒ˜Energy, Eletricity generation planning
οƒ˜Telecommunicaton network design, operation
οƒ˜Buses for the handicapped
οƒ˜Ground holding of aircraft
οƒ˜Cutting problems
οƒ˜β€¦.
οƒ˜Too many to list.
 Provides very strong modeling capabilities (much better than LP alone), but
usually difficult to solve (The solution set is not convex)
linear ο‚« nonlinear, convex ο‚« non-convex
 Recent advances in theory and software makes IP a practical option.
Integer Programming 2013
4
1.1 Modeling Techniques
 Steps
οƒ˜Define necessary variables
οƒ˜Define (construct) constraints so that feasible points correspond to the feasible
solutions of the problem
οƒ˜Define objective function
 May exist many correct, but different formulations. Needs creativity.
οƒ˜Which formulation is better?
 Frequently, use incidence vectors to denote sets
οƒ˜π‘† βŠ† 𝑁, incidence vector of 𝑆 is 𝑛 βˆ’dimensional vector π‘₯𝑆 such that π‘₯𝑗𝑆 = 1 if
𝑗 ∈ 𝑆 and π‘₯𝑗𝑆 = 0 otherwise.
Integer Programming 2013
5
Binary choice
 The 0-1 knapsack problem
𝑛 items
𝑀𝑗 is the weight of item 𝑗, and 𝑐𝑗 is its value
Bound 𝑏 on the weight that can be carried in a knapsack
Select items to be put in the knapsack so that the total value is maximum.
π‘₯𝑗 = 1 if item 𝑗 is selected, and π‘₯𝑗 = 0 otherwise
The capacity bound cannot be exceeded:
Variables are 0-1:
Total value is maximized:
Integer Programming 2013
𝑛
𝑗=1 π‘Žπ‘— π‘₯𝑗
≀𝑏
π‘₯𝑗 ∈ 0, 1 for 𝑗 = 1, … , 𝑛
max
𝑛
𝑗=1 𝑐𝑗 π‘₯𝑗
6
 Variations
οƒ˜Integer knapsack problem
οƒ˜Precedence constrained knapsack problem
Partial orders on projects
project 𝑖 must be done to perform project 𝑗 ( 𝑖 β†’ 𝑗 )
( can be represented as directed graph, use π‘₯𝑖 β‰₯ π‘₯𝑗 in constraints (π‘₯: binary))
ex) repair kit selection, selecting tools for FMS tool magazine, open pit mining,
…
οƒ˜Quadratic knapsack problem: Objective is quadratic function
Integer Programming 2013
7
 Boolean Quadratic Function
max 𝑓 π‘₯ =
𝑛
𝑖=1 𝑑𝑖 π‘₯𝑖
+
𝑖,𝑗,𝑖≠𝑗 𝑐𝑖𝑗 π‘₯𝑖 π‘₯𝑗
, π‘₯𝑖 ∈ 0,1 for all 𝑖.
( use additional variables 𝑦𝑖𝑗 , such that 𝑦𝑖𝑗 = π‘₯𝑖 π‘₯𝑗 for binary π‘₯. Extended
formulation.)
οƒž max
𝑛
𝑖=1 𝑑𝑖 π‘₯𝑖
+
𝑖,𝑗,𝑖≠𝑗 𝑐𝑖𝑗 𝑦𝑖𝑗
π‘₯𝑖 + π‘₯𝑗 βˆ’ 𝑦𝑖𝑗 ≀ 1
βˆ’π‘₯𝑖 + 𝑦𝑖𝑗 ≀ 0
βˆ’π‘₯𝑗 + 𝑦𝑖𝑗 ≀ 0
for all 𝑖, 𝑗, 𝑖 β‰  𝑗
π‘₯𝑖 , 𝑦𝑖𝑗 ∈ 0, 1 for all 𝑖, 𝑗
 constraints ensure that π‘₯𝑖 = π‘₯𝑗 = 1
⟺
𝑦𝑖𝑗 = 1
 The technique will be used in lift and project
Integer Programming 2013
8
 Ex: quadratic knapsack problem, max cut of a graph
Def: Given a graph 𝐺 = (𝑉, 𝐸), and subset 𝑆 βŠ† 𝑉 of vertices, the set of edges
with exactly one endpoint in 𝑆 is called a cut (relative to 𝑆).
 Given 𝐺 = (𝑉, 𝐸), and edge weights 𝑐𝑖𝑗 , 𝑒 = (𝑖, 𝑗) ∈ 𝐸, find a maximum
weight cut of 𝐺.
max
(𝑖,𝑗)∈𝐸 𝑐𝑖𝑗
π‘₯𝑖 1 βˆ’ π‘₯𝑗 + 1 βˆ’ π‘₯𝑖 π‘₯𝑗
π‘₯𝑖 ∈ 0,1 for all 𝑖
(may add constraint π‘₯1 = 1 )
 Note: max cut problem is difficult to solve (NP-hard), but min cut problem is
easy (max-flow min-cut theorem).
Integer Programming 2013
9
Forcing constraints
 Decision A (π‘₯ = 1) can be made only if decision B (𝑦 = 1) also has been made.
π‘₯≀𝑦
 Uncapacitated Facility Location (UFL)
Given potential depots 𝑁 = 1, … , 𝑛 , and a set 𝑀 = 1, … , π‘š of clients.
Fixed cost 𝑐𝑗 to open depot 𝑗, and transportation cost 𝑑𝑖𝑗 if all of client 𝑖 β€² 𝑠
order is delivered from depot 𝑗.
Determine which depots to open, and which depot serves each client so as to
minimize the total cost.
Define 𝑦𝑗 = 1 if depot 𝑗 is open, and 𝑦𝑗 = 0 otherwise
π‘₯𝑖𝑗 is fraction of the demand of client 𝑖 satisfied from depot 𝑗.
Satisfaction of demand of client 𝑖 :
Integer Programming 2013
𝑛
𝑗=1 π‘₯𝑖𝑗
= 1 for 𝑖 = 1, … , π‘š.
10
if depot 𝑗 not opened, then π‘₯𝑖𝑗 = 0.
⟹ π‘₯𝑖𝑗 ≀ 𝑦𝑗 for 𝑖 ∈ 𝑀, 𝑦𝑗 ∈ 0, 1
min
s.t.
𝑛
𝑗=1 𝑐𝑗 𝑦𝑗 +
𝑛
𝑗=1 π‘₯𝑖𝑗
π‘š
𝑖=1
𝑛
𝑗=1 𝑑𝑖𝑗 π‘₯𝑖𝑗
=1
for 𝑖 ∈ 𝑀
π‘₯𝑖𝑗 ≀ 𝑦𝑗 for 𝑖 ∈ 𝑀, 𝑗 ∈ 𝑁
0 ≀ π‘₯𝑖𝑗 ≀ 1 for 𝑖 ∈ 𝑀, 𝑗 ∈ 𝑁, 𝑦𝑗 ∈ 0, 1 for 𝑗 ∈ 𝑁
 Note that there exists an optimal solution with π‘₯𝑖𝑗 = 0 or 1.
Capacitated version?
Integer Programming 2013
11
Relation between variables
𝑛
𝑗=1 π‘₯𝑖𝑗
≀ = 1, π‘₯ ∈ 𝐡𝑛 : Generalized upper bound (GUB) constraint
Integer Programming 2013
12
Disjunctive constraints
 Assume π‘₯ β‰₯ 0
π‘Žβ€² π‘₯ β‰₯ 𝑏, 𝑐 β€² π‘₯ β‰₯ 𝑑,
π‘Ž, 𝑐 β‰₯ 0
at least one of the two constraints needs to be satisfied
οƒž π‘Žβ€² π‘₯ β‰₯ 𝑦𝑏, 𝑐 β€² π‘₯ β‰₯ 1 βˆ’ 𝑦 𝑑, 𝑦 ∈ 0, 1
 General form:
π‘Žπ‘–β€² π‘₯ β‰₯ 𝑏𝑖 , 𝑖 = 1, … , π‘š ( π‘Žπ‘– β‰₯ 0 for all 𝑖)
(at least π‘˜ out of π‘š constraints needs to be satisfied)
π‘š
β€²
οƒž
𝑦𝑖 ∈ 0, 1 , 𝑖 = 1, … , π‘š.
𝑖=1 𝑦𝑖 β‰₯ π‘˜, π‘Žπ‘– π‘₯ β‰₯ 𝑏𝑖 𝑦𝑖 ,
 Ex) machine scheduling: two jobs must be processed on the same machine
and cannot be processed simultaneously.
𝑝𝑖 : processing time of job 𝑖,
𝑑𝑖 : start time of job 𝑖,
οƒž either 𝑑2 β‰₯ 𝑑1 + 𝑝1 or 𝑑1 β‰₯ 𝑑2 + 𝑝2 should hold.
(need a different formulation from above, using big 𝑀)
Note that the feasible solution set is not convex.
Integer Programming 2013
13
Restricted range of values
 Want to restrict a variable x to take values in a set π‘Ž1 , … , π‘Žπ‘š .
οƒž
π‘₯=
π‘š
𝑗=1 π‘Žπ‘— 𝑦𝑗
Integer Programming 2013
,
π‘š
𝑗=1 𝑦𝑗
= 1 , 𝑦𝑗 ∈ 0, 1 for all 𝑗
14
Arbitrary piecewise linear cost functions
 Piecewise linear, not necessarily convex, cost function
(separable piecewise linear convex cost function can be modeled as LP (min
problem, but non-convex (or non-concave) function cannot be modeled as LP)
, 𝑓 π‘₯ = π‘˜π‘–=1 πœ†π‘– 𝑓 π‘Žπ‘– ,
π‘˜
𝑖=1 πœ†π‘– = 1 , πœ†1 , … , πœ†π‘˜ β‰₯ 0
𝑓(π‘₯)
π‘₯=
π‘Ž1 𝑦 π‘Ž2
1
2
1
Integer Programming 2013
𝑦2 π‘Ž 3
3
𝑦3
π‘Ž4
4
π‘˜
𝑖=1 πœ†π‘– π‘Žπ‘–
π‘₯
15
 Formulation:
π‘˜
𝑖=1 πœ†π‘– 𝑓
min
s. t.
π‘Žπ‘–
πœ†1 ≀ 𝑦1 , πœ†π‘˜ ≀ π‘¦π‘˜βˆ’1
πœ†π‘– ≀ π‘¦π‘–βˆ’1 + 𝑦𝑖 , 𝑖 = 2, … , π‘˜ βˆ’ 1,
π‘˜
𝑖=1 πœ†π‘–
= 1,
π‘˜βˆ’1
𝑖=1 𝑦𝑖
=1
πœ†π‘– β‰₯ 0, for all 𝑖,
𝑦𝑖 ∈ 0, 1 , for all 𝑖
Integer Programming 2013
16
 Alternative formulation
𝐿𝑗 𝑀𝑗 ≀ π‘₯𝑗 ≀ 𝐿𝑗 π‘€π‘—βˆ’1 , 𝑗 = 1,2, … , π‘˜
𝑀0 = 1
𝑀𝑗 ∈ 0, 1 , 𝑗 = 1,2, … , π‘˜
π‘₯𝑗 β‰₯ 0, 𝑗 = 1,2, … , π‘˜
𝑓(π‘₯)
𝑓 = 𝐾 + 𝑐1π‘₯1 + 𝑐2π‘₯2 + β‹― + π‘π‘˜π‘₯π‘˜
Note that constraints imply 𝑀𝑗 ≀ π‘€π‘—βˆ’1
𝐾
𝑀0
𝑀1
𝐿1
Integer Programming 2013
𝑀3
𝑀2
𝐿2
π‘₯
𝐿3
17
Set covering, set packing, set partitioning
 𝑀 = {1, … , π‘š}, 𝑁 = {1, … , 𝑛}
𝑀1 , 𝑀2 , … , 𝑀𝑛 are collection of subsets of 𝑀.
cost 𝑐𝑗 for each subset 𝑀𝑗
 𝐹 βŠ† 𝑁 is a cover of 𝑀 if
π‘—βˆˆπΉ 𝑀𝑗
=𝑀
𝐹 is a packing of 𝑀 if 𝑀𝑗 β‹‚π‘€π‘˜ = βˆ… for all 𝑗, π‘˜ ∈ 𝐹, 𝑗 β‰  π‘˜
𝐹 is a partition of 𝑀 if it is both a cover and a packing of 𝑀.
weight of a subset 𝐹 of 𝑁 is defined as
 Let 𝐴: π‘š × π‘› with π‘Žπ‘–π‘— = 1,
π‘—βˆˆπΉ 𝑐𝑗
if 𝑖 ∈ 𝑀𝑗 ,
= 0, otherwise
οƒž 𝐴π‘₯ β‰₯ 𝑒, 𝐴π‘₯ ≀ 𝑒, 𝐴π‘₯ = 𝑒, π‘₯ ∈ 𝐡𝑛
Note that 𝐴π‘₯ =
Integer Programming 2013
𝑛
𝑗=1 𝐴𝑗 π‘₯𝑗 ,
( 𝑒 : unit vector)
where 𝐴𝑗 is 𝑗 βˆ’ π‘‘β„Ž column of 𝐴.
18
Sequencing problem with setup times
 One machine, π‘š operations
operation 𝑗 requires unique tool 𝑗
capacity of tool magazine is 𝐡 < π‘š
loading or unloading tool 𝑗 into the magazine requires 𝑠𝑗 units of setup time
𝑛 jobs need to be performed by the machine and each job 𝑖 requires multiple
operations 𝐽𝑖 , 𝐽𝑖 ≀ 𝐡
(setup time required prior to each job is sequence dependent)
 Determine the optimal job sequence that minimizes total setup time. Assume
the magazine is empty initially.
Integer Programming 2013
19
 Let
π‘₯π‘–π‘Ÿ = 1,
= 0,
if job 𝑖 is the π‘Ÿ βˆ’th job processed
otherwise
π‘¦π‘—π‘Ÿ = 1,
if tool 𝑗 is on the magazine while the π‘Ÿ βˆ’th job is processed
= 0,

otherwise
𝑦𝑗0 = 0, for all j. (or may use initial magazine setting)
𝑛
π‘Ÿ=1 π‘₯π‘–π‘Ÿ = 1,
𝑛
𝑖=1 π‘₯π‘–π‘Ÿ = 1,
π‘₯π‘–π‘Ÿ ≀ π‘¦π‘—π‘Ÿ ,
π‘š
𝑗=1 π‘¦π‘—π‘Ÿ
Integer Programming 2013
≀ 𝐡,
for all 𝑖.
for all r.
(job 𝑖 must be done)
(π‘Ÿ βˆ’ π‘‘β„Ž job must be done)
for all 𝑗 ∈ 𝐽𝑖 , for all π‘Ÿ, 𝑖.
for all π‘Ÿ.
20
π‘š
𝑗=1
minimize
𝑛
π‘Ÿ=1 𝑠𝑗
π‘š
𝑗=1
οƒž minimize

π‘š
𝑗=1
minimize
π‘¦π‘—π‘Ÿ βˆ’ 𝑦𝑗,π‘Ÿβˆ’1
𝑛
π‘Ÿ=1 𝑠𝑗 π‘§π‘—π‘Ÿ
π‘§π‘—π‘Ÿ β‰₯ π‘¦π‘—π‘Ÿ βˆ’ 𝑦𝑗,π‘Ÿβˆ’1 ,
for all 𝑗, π‘Ÿ,
π‘§π‘—π‘Ÿ β‰₯ 𝑦𝑗,π‘Ÿβˆ’1 βˆ’ π‘¦π‘—π‘Ÿ ,
for all 𝑗, π‘Ÿ.
𝑛
π‘Ÿ=1 𝑠𝑗 π‘§π‘—π‘Ÿ
π‘§π‘—π‘Ÿ β‰₯ π‘¦π‘—π‘Ÿ βˆ’ 𝑦𝑗,π‘Ÿβˆ’1 ,
for all 𝑗, π‘Ÿ,
π‘§π‘—π‘Ÿ β‰₯ 𝑦𝑗,π‘Ÿβˆ’1 βˆ’ π‘¦π‘—π‘Ÿ ,
for all 𝑗, π‘Ÿ,
𝑛
π‘Ÿ=1 π‘₯π‘–π‘Ÿ = 1,
𝑛
𝑖=1 π‘₯π‘–π‘Ÿ = 1,
π‘₯π‘–π‘Ÿ ≀ π‘¦π‘—π‘Ÿ ,
π‘š
𝑗=1 π‘¦π‘—π‘Ÿ
Integer Programming 2013
≀ 𝐡,
for all 𝑖.
for all π‘Ÿ.
for all 𝑗 ∈ 𝐽𝑖 , for all π‘Ÿ, 𝑖.
for all π‘Ÿ.
21
Uncapacitated lot sizing (ULS) (NW)
 Production plan for a 𝑇 βˆ’period horizon for a single product.
𝑐𝑑 is the fixed cost (set-up) of producing in period 𝑑.
𝑝𝑑 is the unit production cost in period 𝑑.
β„Žπ‘‘ is the unit storage cost in period 𝑑.
𝑑𝑑 is the demand in period 𝑑.
Variables:
𝑦𝑑 is the amount produced in period 𝑑.
𝑠𝑑 is the stock at the end of period 𝑑.
π‘₯𝑑 = 1 if production occurs in 𝑑, and π‘₯𝑑 = 0 otherwise.
Integer Programming 2013
22
 Formulation:
min
𝑇
𝑑=1
𝑝𝑑 𝑦𝑑 + β„Žπ‘‘ 𝑠𝑑 + 𝑐𝑑 π‘₯𝑑
𝑦1 = 𝑑1 + 𝑠1
π‘ π‘‘βˆ’1 + 𝑦𝑑 = 𝑑𝑑 + 𝑠𝑑
𝑦𝑑 ≀ πœ”π‘₯𝑑
𝑠𝑇 = 0
𝑠, 𝑦 ∈ 𝑅+𝑇 , π‘₯ ∈ 𝐡𝑇 ,
where πœ” =
𝑇
𝑑=1 𝑑𝑑
Integer Programming 2013
for 𝑑 = 2, … , 𝑇
for 𝑑 = 1, … , 𝑇
is an upper bound on 𝑦𝑑 for all 𝑑.
23
 Alternative formulation:
Define π‘žπ‘–π‘‘ as the quantity produced in period 𝑖 to satisfy demand in period 𝑑 β‰₯ 𝑖.
min
𝑇
𝑑=1
𝑑
𝑖=1
𝑝𝑖 + β„Žπ‘– + β„Žπ‘–+1 + β‹― + β„Žπ‘‘βˆ’1 π‘žπ‘–π‘‘ +
𝑑
𝑖=1 π‘žπ‘–π‘‘
= 𝑑𝑑 ,
𝑇
𝑑=1 𝑐𝑑 π‘₯𝑑
for 𝑑 = 1, … , 𝑇
π‘žπ‘–π‘‘ ≀ 𝑑𝑑 π‘₯𝑖 ,
for 𝑖 = 1, … , 𝑇 and 𝑑 = 𝑖, … , 𝑇
𝑇(𝑇+1)/2
π‘₯ ∈ 𝐡𝑇 ,
π‘ž ∈ 𝑅+
,
 If we replace π‘₯ ∈ 𝐡𝑇 , by 0 ≀ π‘₯𝑑 ≀ 1 for all 𝑑, then the LP has an optimal
solution with π‘₯ ∈ 𝐡𝑇 . Hence this is a stronger formulation.
 The formulation is a special case of the uncapacitated facility location problem.
Substitute 𝑦𝑖𝑑 = π‘žπ‘–π‘‘ /𝑑𝑑 for all 𝑖 and 𝑑 β‰₯ 𝑖.
 Extensions: capacitated lot sizing, multiple item lot sizing, …
Integer Programming 2013
24