View
50
Download
3
Category
Tags:
Preview:
DESCRIPTION
Perspective of supply chain optimization. Tokyo University of Marine Science and Technology Mikio Kubo. Agenda. Supply Chain and Analytic IT Mathematical Programming Solver Gurobi with Python language Constrained Programming Solver SCOP Scheduling Solver OptSeq. What’s the Supply Chain?. - PowerPoint PPT Presentation
Citation preview
Perspective of supply chain optimization
Tokyo University of Marine Science and Technology
Mikio Kubo
Agenda
• Supply Chain and Analytic IT• Mathematical Programming Solver Gurobi
with Python language• Constrained Programming Solver SCOP• Scheduling Solver OptSeq
What’s the Supply Chain?
IT(Information Technology)+ Logistics = Supply Chain
配送計画
スケジューリングロットサイズ決定
安全在庫配置在庫方策
ロジスティクス・ネットワーク設計
需要予測収益管理
Logistics Network Design
Safety Stock Allocation
Vehicle Routing/Scheduling
ForecastingRevenue Management
Lot-SizingScheduling
Logistic System, Transactional IT, Analytic IT
実 シ ス テ ム
IT処 理 的
IT解 析 的
Logistic System=Truck, Ship, Plant, Product, Machine, …
Transactional ITPOS, ERP, MRP, DRP…Automatic Information Flow
Analytic ITModel + Algorithm=Decision Support System
brain
muscle
nerve
Levels of Decision Making
Strategic LevelStrategic Level
Tactical LevelTactical Level
Operational LevelOperational Level
A year to several years; long-term decision making
A week to several months; mid-term decision making
Real time to several days; short-term decision making
Transactional IT
Analytic IT
Models in Analytic IT
Logistics Network Design
Inventory
Safety stock allocationInventory policy
optimization
Production
Lot-sizingScheduling
TransportationDelivery
Vehicle Routing
Multi-period Logistics Network Design
Strategic
Tactical
Operational
Plant DCSupplier Retailer
How to Solve Real SC Optimization Problems Quickly
• Mixed Integer Programming (MIP) SolverGurobi =>Logistics Network Design, Lot-Sizing
• Constraint Programming (CP) Solver SCOP =>Lot-Sizing, Staff Scheduling
• Scheduling Solver OptSeq =>Scheduling• Vehicle Routing Solver • Inventory Policy Optimization Solver
... using Python Language
Why Python?
• We can do anything by importing some modules
• Optimization import gurobipy (MIP)import SCOP (CP)
• Draw graphsimport networkX
• Also fly! import antigravity ?
http://xkcd.com/353/
What’s Gurobi?MIP solver Developed by: Zonghao Gu, Edward Rothberg , Robert Bixby
Free academic license
Introduction to Gurobi (1)
• Create a model objectmodel = Model("Wine Blending")
• Add variable objectsx1 = model.addVar(name="x1")x2 = model.addVar(name="x2")x3 = model.addVar(name="x3")
• Model update (needed before adding constraints; lazy update!)model.update()
Introduction to Gurobi (2)
Introduction to Gurobi (3)• Set the objective
model.setObjective(15*x1 + 18*x2 + 30*x3, GRB.MAXIMIZE)
• Add constraints model.addConstr(2*x1 + x2 + x3 <= 60)model.addConstr(x1 + 2*x2 + x3 <= 60)model.addConstr(x3 <= 30)
• Optimizemodel.optimize()
Mr. Python is too lazy. His room is always mess.He asked to the God of Python.“How can I tide up my toys?”
The God replied from the heaven.“Use the list. The charm is “Abracadabra [ ].”Mr. Python said “L=[ ].”What a miracle! Some boxes were fallen from the heaven.The God said. “Tide up the toys using these boxes.”
OK. Everything is packed into the list.To pick up “Teddy”, just say “L[3].”
To sort the toys in alphabetical order, just say “L.sort().”
Note that L is a list object and sort() is a function definedin the object called “method.”
Modeling with Lists
• Add variable objects into list x=[] for i in range(3): var=model.addVar(name=“x[%s]”%i) x.append(var)
• Add constraint “x1 + x2 + x3 <= 2”model.addConstr( sum(x) <= 2 ) or model.addConstr( quicksum(x) <= 2 )
Mr. Python is impatient, too. He complained to the God. “I’d like to pick my toys immediately.” The God replied from the heaven again. “Use the dictionary. The charm is “Abracadabra {}.”
Using lists and dictionaries, Mr. Python could manage his toysefficiently and lived happily ever after.
Modeling with Dictionaries
• Dictionary that maps keys (“Dry”, “Medium”, “Sweet”) to variable objects x={} x[“Dry”]= model.addVar(name=“Dry”) x[“Medium”]= model.addVar(name=“Medium”) x[“Sweet”]= model.addVar(name=“Sweet”)
• Add constraintmodel.addConstr( 2*x[“Dry”]+ x[“Medium”] +x[“Sweet”] <=30 )
Wine Blending with Dictionaries (1)
Blends, Profit = multidictmultidict({"Dry":15, "Medium":18, "Sweet":30})
=> Blends=["Dry", "Medium“, "Sweet“] List of Keys Profit[“Dry”]=15, Profit[“Medium”]=18, ...
Grapes, Inventory = multidict({"Alfrocheiro":60, "Baga":60, "Castelao":30})
Use = { ("Alfrocheiro","Dry"):2, ("Alfrocheiro","Medium"):1, ("Alfrocheiro","Sweet"):1, ("Baga","Dry"):1, .... }
Wine Blending with Dictionaries (2)
x = {}for j in Blends: x[j] = model.addVar(vtype="C", name="x[%s]"%j)model.update()
model.setObjective(quicksum(Profit[j]*x[j] for j in Blends), GRB.MAXIMIZE)
for i in Grapes: model.addConstr(quicksum(Use[i,j]*x[j] for j in Blends)
<= Inventory[i], name="use[%s]"%i)
model.optimize()
k-median problem• A facility location problem with min-sum
object• Number of customers n=200, number of
facilities selected from customer sites k=20• Euclidian distance , coordinates are
random
Formulation
weak formulation
Python Code ( 1 )from gurobipy import *
model = Model("k-median")
x, y = {}, {} # empty dictionaries
Key“Hanako”,
(1,2)
Value“127cm”
Variable ObjectMapping
Dictionary Data Structure
I=range(n)J=range(n)for j in J:
y[j] = model.addVar(vtype="B", name="y[%s]"%j)
for i in I:
x[i,j] = model.addVar( vtype="B",name="x[%s,%s]"%(i,j))
model.update()
Python Code (2)
model.setObjective(quicksum(c[i,j]*x[i,j] for i in I for j in J))
Add variable objects“B” means binary variable or GRB.BINARY
Set the objective
Python Code (3) for i in I:
model.addConstr(quicksum(x[i,j] for j in J) = = 1, "Assign[%s]"%i)
for j in J:
model.addConstr(x[i,j] <= y[j], "Strong[%s,%s]"%(i,j))
model.addConstr(quicksum(y[j] for j in J) = = k, "k_median")
Optimize a model with 401 Rows, 40200 Columns and 80400 NonZeros
…
Explored 1445 nodes (63581 simplex iterations) in 67.08 seconds
Thread count was 2 (of 2 available processors)
Optimal solution found (tolerance 1.00e-04)
Best objective 1.0180195861e+01, best bound 1.0179189780e+01, gap 0.0099%
Opt.value= 10.1801958607
Weak formulation (result)n=200,k=20
Upper and lower bounds (Weak Formulation)
0
2
4
6
8
10
12
14
16
18
0 10 20 30 40 50 60 70
CPU
Obj. F
unc.
Value
Optimize a model with 40401 Rows, 40200 Columns and 160400 NonZeros
…
Explored 0 nodes (1697 simplex iterations) in 3.33 seconds(No branching !)
Thread count was 2 (of 2 available processors)
Optimal solution found (tolerance 1.00e-04)
Best objective 1.0180195861e+01, best bound 1.0180195861e+01, gap 0.0%
Opt.value= 10.1801958607
Strong formulation (result)
k-center problem
• A facility location problem with min-max object
• 100 customers , 10 facilities
k-center (n=30,k=3) k-median (n=30,k=3)
Upper and lower bounds
(n=100,k=10)
0
0.2
0.4
0.6
0.8
1
1.2
0 50 100 150 200 250 300 350 400
CPU Time
Obj. F
un. V
alue
k-Covering Problem
=1 if customer is not covered
# of uncovered customers
parameter that is =1 if distance is less than or equal to θ
k-Covering+Binary Search
Upper and Lower Bounds UB , LB while UB – LB >ε:
θ= (UB+LB)/2 if opt. val. of k-covering is 0 then
UB = θ else LB = θ
Computational Experiments
Traveling salesman problem• Find a minimum cost (distance) Hamiltonian
circuit • World record 85,900 nodes (symmetric
instance) -> We try to solve asymmetric ones.
Miller-Tucker-Zemlin formulation
Upper and lower bounds( 80 nodes , Euclid TSP )
0
5
10
15
20
25
30
35
40
45
0 50 100 150 200 250 300 350 400
CPU
Obj. F
unc.
Value
Non-lifted MTZ constraints-> Out of memoryafter running 1 day
ResultOptimize a model with 6480 Rows, 6400 Columns and 37762 NonZeros
…
Cutting planes:
Gomory: 62
Implied bound: 470
MIR: 299
Zero half: 34
Explored 125799 nodes (2799697 simplex iterations) in 359.01 seconds
Optimal solution found (tolerance 1.00e-04)
Best objective 7.4532855108e+00, best bound 7.4525704995e+00, gap 0.0096%
Opt.value= 7.45328551084
Graph coloring problem
• An example that has symmetric structure of solutions
• Number of nodes n=40 , maximum number of colors Kmax=10
• Random graph G(n,p=0.5)
Formulation
Weak formulation
n=40 , Kmax=10
0
2
4
6
8
10
12
0 200 400 600 800 1000 1200 1400
CPU Time
Obj. F
unc.
Value
Optimize a model with 3820 Rows, 410 Columns and 11740 NonZeros
Explored 17149 nodes (3425130 simplex iterations) in 1321.63 seconds
Improvement of the formulation
Avoid symmetric variables
SOS: Special Ordered Set ) Type 1
model.addSOS(1,list of var.s)
Avoid symmetric variables
0
2
4
6
8
10
12
0 50 100 150 200 250 300 350 400 450
CPU
Obj. F
unc.
Value
Optimize a model with 3829 Rows, 410 Columns and 11758 NonZeros
Explored 4399 nodes (1013290 simplex iterations) in 384.53 seconds
MIPFocus=2 ( priority=proving the optimality) 67secMIPFocus=3 (priority=lower bound) 70 sec.
+SOS constraints
Optimize a model with 3829 Rows, 410 Columns and 11758 NonZerosExplored 109 nodes (58792 simplex iterations) in 22.02 seconds
MIPFocus=2 65 sec. , MIPFocus=3 126 sec.
0
2
4
6
8
10
12
0 5 10 15 20 25
CPU
Obj. F
unc.
Val.
Fixed-K approach
If the end vertices of an edge have the same color, the edge is called bad, and the corresponding variable z is equal to 1
Number of “bad” edges
Fixed-K Approach +Binary Search
UB, LB := Upper and lower bounds of Kwhile UB – LB >1:
K= [ (UB+LB)/2 ] [ ] : Gauss notation if obj. fun. of Fixd-K model = 0 then UB = K
else LB = K
Fixed-K Approach +Binary Search
Improved Formulation
SCOP Solver for COnstraint Programming
Log Opt Co., Ltd.
Agenda
• Introduction • SCOP Interfaces• Demonstration• Benchmark• Case Study
What’s Constraint ProgrammingConstraint Programming is a paradigm to solve
combinatorial problems efficiently
• Constraint Satisfaction Problem (CSP) – seeks an assignment of values to variables
such that all the given constraints are satisfied
Constraint Satisfaction ProblemConstraint satisfaction problem consists of:
• variable: variable chooses a value from its domain.
• domain: a finite set of values for each variable.
• constraint: a logical relation among several variables.
Weighted Constraint Satisfaction Problem (WCSP)
• WCSP is an enhanced framework of CSP • Not just seeks an assignment that satisfies all of the
constraints but to minimize the weighted sum of infeasibility of constraints (called penalties): – Hard Constraint
weight is infinity, i.e., constraint must be satisfied– Soft Constraint
weight is a positive integer, i.e., constraint may be violated by paying penalty
• The goal is to minimize the total penalties =>optimization model.
What’s SCOP
• Based on Metaheuristics by Ibaraki (Kyotyo-University), Nonobe (Hosey-University)
• Trial version (15 variables available ) http://www.logopt.com/scop.htm
• 1. Simple modeling language (text file) • 2. Python interface• 3. Library ( C++, .Visual Basic, C# )
Solver to solve a large combinatorial problems effectively
SCOP is a solver for solving WCSP
SCOP Model
• variable • domain• constraint:
–weight = positive integer ( soft constraint ) inf ( hard constraint )
– type = linear , alldiff, quadratic
Assignment Problem• Assign 5 workers A,B,C,D,E to 3 jobs 0,1,2• Each job (0,1,2) needs at least (1,2,2) workers• Worker A and worker C have to assign to different
jobs• Assignment cost = 0 1 2
A 15 20 30
B 7 15 12
C 25 10 13
D 15 18 3
E 5 12 17
The object is to minimize sum of the
assignment cost
variable A in {0, 1, 2}variable B in {0, 1, 2}variable C in {0, 1, 2}variable D in {0, 1, 2}variable E in {0, 1, 2}
Variable and domain• Variables are workers A,B,C,D,E• Domain for each variables is set of jobs {0,1,2}
variable var-name in { domain }
domain = value1, value2, value3, ...
constraint0: weight=inf type=linear 1(A,0) 1(B,0) 1(C,0) 1(D,0) 1(E,0) >=1constraint1: weight=inf type=linear 1(A,1) 1(B,1) 1(C,1) 1(D,1) 1(E,1) >=2constraint2: weight=inf type=linear 1(A,2) 1(B,2) 1(C,2) 1(D,2) 1(E,2) >=2
Linear constraint ( 1 )• Each job (0,1,2) needs at least (1,2,2) workers
0 1 2
A 15 20 30
B 7 15 12
C 25 10 13
D 15 18 3
E 5 12 17
Con-name : weight= integer or inf type= linear
coeff1(var-name1,value1) coeff2(var-name2,value2).... <= (>=, =) right hand side
hard constraint
obj: weight=1 type=linear 15 (A, 0) 20(A, 1) 30(A, 2) 7 (B, 0) 15(B, 1) 12(B, 2) 25 (C, 0) 10(C, 1) 13(C, 2) 15 (D, 0) 18(D, 1) 3(D, 2) 5 (E, 0) 12(E, 1) 17(E, 2) <=0
Linear constraint ( 2 )Wright objective function as linear constraint( object value = sum of the penalty cost ) 0 1 2
A 15 20 30
B 7 15 12
C 25 10 13
D 15 18 3
E 5 12 17
hard constraintSum of the assignment cost <=0
quad: weight=100 type=quadratic 1 (A,0) (C,0) 1 (A,1) (C,1) 1 (A,2) (C,2) <=0
Quadratic constraint
Con-name : weight= integer or inf type= quadraticcoeff1(var-name1,value1) (var-name2,value2) coeff2(var-name3,value3) (var-name4,value4) ....
Worker A and worker C have to assign to different jobs
larger than the weitht in objective function
AllDiff: weight= 100 type=alldiff A C ;
Alldifferent constraint
Con-name : weight= integer or inf type= alldiffvar-name1 var-name2 var-name3 .... ;
Worker A and worker C have to assign to different jobs
How to use SCOP solver
• Start with Command Poompt (or Colsole)
• scop < file name
• scop - ( option ) <file name
• scop -help (display all of the SCOP options)
SCOP options-noadjust deactivate weight adjustment mechanism-display # set log display level-iteration # set iteration limit-interval # set log display interval-noimprovement # set iteration limit for no improvement-seed # set random seed-target # set target-time #.# set CPU time limit in second
Result (solved by SCOP)scop <ex3-scop.dat# reading data ... done: 0.00(s)
penalty = 1/52 (hard/soft), time = 0.00(s), iteration = 0# improving the initial solution greedilypenalty = 0/157 (hard/soft), time = 0.00(s), iteration =
0# start tabu searchpenalty = 0/60 (hard/soft), time = 0.01(s), iteration = 2penalty = 0/52 (hard/soft), time = 0.01(s), iteration = 8# penalty = 0/52 (hard/soft)# cpu time = 0.01/0.03(s)# iteration = 8/100[best solution]A: 0B: 2C: 1D: 2E: 1
penalty: 0/52 (hard/soft)[Violated constraints]obj: 52
Obj : 52 =15+12+10+3+12
0 1 2A 15 20 30
B 7 15 12C 25 10 13
D 15 18 3E 5 12 17
Summary 1. variable & domain
variable var-name in { value1, value2, ... }
2. target ( sum of the penalty ) target = target-value
3. constraintscon-name: weight = interger / inftype = linear / quadratic / alldiff
cnstraint
Steps 1 and 2 have to declare before Step 3 !
Graph Coloring
Have to assign to different color class!
・・・
Graph Coloring
Graph Coloring Programs
SCOP Gurobi
Test results (Graph Coloring)• Fixed the number of color
*(1) 16 constraint violation after 828 seconds
# of nodes # of edges # of colors SCOP (seconds)
Gurobi (seconds)
30 0.5 7 0.01 0.0750 0.5 9 0.16 29100 0.5 15 0.66 - *(1)
500 0.5 54 50.9 -800 0.5 80 74.45 -
Quadratic Assignment Problem
The number of times who meets each other in one week
3
1 2
- -
Distances between two houses
2km5km
1km
Quadratic Assignment Problem
3
1 2
- -
2km5km
1km
2×2+ 5×1+ 1×3= 12km
- -
Test result (QAP)nodes Gurobi (seconds) SCOP
(seconds)Gaps % (Gurobi/SCOP)
5 0.03 0.01 08 12.84 0.23 010 1589 1.76 020 140 138.2 4.925 300 298.2 3.530 540 534.4 1.5
Application of SCOP• Staff scheduling problem• Time tabling problem• Graph partition problem• Maximum stable set problem• Graph coloring problem • Quadric assignment problem • Travelling sails man problem• Multiple knapsack problem• Process Scheduling in Chemical Plants
Scheduling optimization systemOptSeq
http://www.logopt.com/OptSeq/OptSeq.htm
Log Opt Co., Ltd.
What is the scheduling?
• Allocation of activities (jobs, tasks) over time – Resource constraints. For example, machines,
workers, raw material, etc. may be scare resources.
– Precedence (or temporal) relation between activities. For example., some activities cannot start unless other activities finish.
Take off the airplane a.s.a.p. !
You’re a consultant of an airline company. Your job is to find a schedule that takes off the airplane as soon as possible. We need several activities before taking off the airplane. Firstly let the passengers get off and unload their baggage; secondly clean up the cabin; finally let new passengers get on and load their baggage. What is the best (shortest) schedule for taking off the airplane?
PERT• PERT: Program Evaluation and Review Technique that was used to
get a schedule during World War II
22分25分
13分 15分 27分
1作 業
2作 業
3作 業 4作 業
5作 業
ダ ミ ー 作 業
Temporal relation
Activity1 : Get off passengers (13 min.)Activity2 : Unload baggage (25 min.)Activity3 : Clean up the cabin (15 min.)Activity4 : Get on passengers (27 min.)Activity5 : Load baggage (22 min.)
Completion time (make-span) is minimized
Dummy activity(take-off)
Act 1
Act 2
Act 3 Act 4
Act 5
Act sink
Modeling with OptSeq (1)Activity
activity act1 mode duration 13
activity Activity-Name duedate Integer+ mode duration Integer+
Description ofActivity
E.g., to add an activity named act1 with duration (processing time) 13 :
Activity must have at least one mode (the way to execute the activity)
Duedate is optional
Modeling with OptSeq ( 2 )Temporal Constraint
temporal act1 act3
temporal Predecessor Successor Description ofTemporal Constraint
E.g., to define that activity act3 must start after finishing activity act1:
Modeling with OptSeq ( 3 )Objective
activity sink duedate 0
Objective Minimize the latest completion time (makespan)
sink: the dummy activity that must be executed after all activitiesWe minimize the delay time of sink:
activity Activity-Name duedate Integer+Description ofActivity
Optimization and Result
optseq -time 3 < Input-file-nameTime Limit is 3 sec.
--- best solution --- source ---: 0 0 dummy source starts and finishes at time 0 sink ---: 55 55 dummy sink starts and finished at time 55 activity[1] ---: 0 0--13 13activity[2] ---: 0 0--25 25activity[3] ---: 13 13--28 28activity[4] ---: 28 28--55 55activity[5] ---: 25 25--47 47
objective value = 55 latest completion time (makespan) is 55cpu time = 0.00/3.00(s) computational time is 0 sec.iteration = 1/62605 number of iteration of tabu search is 1
Result
PERT with Resource Constraint
resource Resource-Name interval Time1 Time2 capacity Integer+ ...
Description ofResource
Period
Time
“Interval 1 3” means period 1, 2
Modeling Resources with OptSeq
resource worker interval 0 inf capacity 1Resource “worker”can be used from 0 to infinity ( inf )with capacity 1
activity Activity-Name Resource-Name interval Time1 Time2 requirement Integer+ ...
Activity requiresresource
activity act1 mode duration 13 worker interval 0 13 requirement 1
Activity “act1”requires resource“worker” by 1 unit
Optimization and Result
source ---: 0 0sink ---: 102 102activity[1] ---: 47 47--60 60activity[2] ---: 0 0--25 25activity[3] ---: 60 60--75 75activity[4] ---: 75 75--102 102activity[5] ---: 25 25--47 47
objective value = 102cpu time = 0.00/3.00(s)iteration = 0/64983
Result
Optimal solution ( Gantt’s chart )
13分
1作 業15分
3作 業27分
4作 業
25分
2作 業22分
5作 業
時 間0 55
Resource constrained schedule (unit resource upper bound)
15分 3作 業
27分 4作 業
13分 1作 業
25分 2作 業
22分 5作 業
時 間0 102
Example 2Minimize the Pit-in time!
You’re a staff of F1 race. There are three pit staffs who have to do some tasks for your F1 car. Find the best schedule that minimizes the pit-in time.
Temporal (Precedence) relation and the processing time
gas
4
4
4
4
2
3
2
2
2
11作業1
作業2
作業3
作業4
作業5
作業6
作業7
作業8
作業9
作業10
秒
秒
秒
秒
秒
秒
秒
秒
秒
秒
3 staffs(resource constraint)
3 sec.
Task
Task
Task
TaskTask
Task Task
Task
Task
Task
11 sec.
2 sec.
2 sec.
2 sec.
2 sec.
4 sec.
4 sec.
4 sec.
4 sec.
Modeling with OptSeq -using a resource with capacity 3-
resource worker interval 0 inf capacity 3
activity prepare mode duration 3 worker interval 0 3 requirement 1...
temporal prepare oiltemporal jackup tire1...
activity sink duedate 0
Define a resource“worker” with capacity 3
Temporal constraints
Minimize themakespan
Optimization by OptSeqand Gantt’s chart
source ---: 0 0sink ---: 14 14prepare ---: 0 0--3 3water ---: 0 0--2 2front ---: 0 0--2 2jackup ---: 2 2--4 4tire1 ---: 8 8--12 12tire2 ---: 4 4--8 8tire3 ---: 8 8--12 12tire4 ---: 4 4--8 8oil ---: 3 3--14 14jackdown ---: 12 12--14 14
objective value = 14cpu time = 0.00/3.00(s)iteration = 0/37644
Another Model - using multiple modes -
1. Convenience Store Mode : Duration (Processing Time) 20 min. requires Money Resource 110 yen and human resource 1
2. Vending Machine Mode : Duration 20 min. requires Money 120 yen and human resource 13. Supermarket Mode: Duration 20 min.
requires Money 120 yen, human resource 1 and car resource 1
Mode : The way for processing an activity
Example : Activity “Buy a juice”
Mode (1)
mode Mode-Name duration Processing-Time Resource-Name interval Time1 Time2 requirement Integer+ ...
Description of Mode
activity Activity-Name Mode-Name1 Mode-Name2 ....
Add modesto activity
Mode (2)
mode m1 duration 3 worker interval 0 3 requirement 1
mode m2 duration 2 worker interval 0 2 requirement 2
mode m3 duration 1 worker interval 0 1 requirement 3
E.g., an activity has 3 difference modes; m1, m2 and m3 :
activity prepare m1 m2 m3
Add 3 modes to activity “prepare”
Mode Resource
single worker mode
double worker mode
triple worker mode
Result and Gantt’s chart
--- best solution ---source ---: 0 0sink ---: 13 13prepare m3: 0 0--1 1water ---: 1 1--3 3front ---: 11 11--13 13jackup ---: 1 1--3 3tire1 ---: 7 7--11 11tire2 ---: 3 3--7 7tire3 ---: 7 7--11 11tire4 ---: 3 3--7 7oil ---: 1 1--12 12jackdown ---: 11 11--13 13
objective value = 13cpu time = 0.00/3.00(s)iteration = 7/23318
activity “prepare” was done by mode m3, i.e., execute by 3 worker with duration 1
Resource Constrained Project Scheduling
土 台
1 階
内 装
屋 根
完 成 !
時 間 ( 日 )
資 源 量 ( 人 )
30
2
1 worker rests onthe 3rd day
Duration : 2 days 1 worker on the 1st dat 2 workers on the 2nd day
BasementFirst Floor Ceiling
Interior
Workers
Completion!
Modeling with OptSeq (1)
resource worker interval 0 2 capacity 2 interval 2 3 capacity 1 interval 3 inf capacity 2
Time Dependent Resource Capacity
0 2 3
1
Resource Capacity
Modeling with OptSeq (2)
Time DependentResource Usage ofActivity
activity first mode duration 3 worker interval 0 1 requirement 2 worker interval 1 3 requirement 1
Optimal Solution
時 間 ( 日 )
資 源 量 ( 人 )
Resource Constrained Project Scheduling (RCPSP) is a generic model ( job shop and flow shop scheduling problems are special cases.)
Resource Capacity
Critical Path Method (CPM)
Consider “Take off the airplane” again! However, each activity has an emergency modeActivity1 : Get off passengers (13min.) => Emergency mode (10 min. ) requires 10000 yenActivity2 : Unload baggage (25min.) => Emergency mode (20 min. ) requires 10000 yenActivity3 : Clean up the cabin (15min.) => Emergency mode (10 min. ) requires 10000 yenActivity4 : Get on passengers (27 min.) => Emergency mode (25 min. ) requires 10000 yenActivity5 : Load baggage (22 min.) => Emergency mode (20 min. ) requires 10000 yen
Renewable Resources andNon-renewable Resources
• Renewable resourcescan be used again after the completion of activities; for example, machines and/or workers are renewable
• Non-renewable resourcesare not renewed after the completion of activities; for example, money and/or ingredients are non-renewable
CPM can be modeled using a non-renewable resource
mode m[1][1] duration 13 mode m[1][2] duration 10
activity activity[1] m[1][1] m[1][2]
Modeling with OptSeq (1)
Activity 1 “Get off passengers” takes:13 minutes (normal mode) m[1][1] or10 minutes (emergency mode) m[1][2]
nonrenewable +1 (activity[1],m[1][2]) +1 (activity[2],m[2][2]) +1 (activity[3],m[3][2]) +1 (activity[4],m[4][2]) +1 (activity[5],m[5][2]) <= 4
Modeling with OptSeq (2)
Declaration ofnon-renewableresource
nonrenewable Amount1 (Activity-Name1,Mode-Name1) Amount2 (Activity-Name2,Mode-Name2) ... <= Upper-Bound (or Capacity)
Budget (Capacity of money resource) is 40000 yen.
Note that Amounts and Capacity may be 0 or negative integer.
Results10分
1作業
13分
1作業
10分
3作業
10分
3作業
25分
4作業
27分
4作業
20分
2作業
25分
2作業
22分
5作業
22分
5作業
時間
時間
0
0
45
13分
1作業15分
3作業27分
4作業
25分
2作業22分
5作業
時間0 55
52
4万円
1万円
0万円
Budget is40000 yen.
Budget is10000 yen.
Budget is 0 yen.
Emergency mode
Type of precedence relation
– =1: Finish ->Start– =2: Finish ->Finish– =3: Start ->Start– =4: Start ->Finish
Predecessor
Successor
Set-up time lower boundSet-up time upper bound
Finish Start
OptSeq Capability
• OptSeq is a solver for Resource Constrained Project Scheduling Problem with:– Time-Dependent Resource Usage and Capacity– Non-renewable Resource Constraints– Generic Temporal Constraintsalso it is possible to:– declare activities are breakable and/or processed in parallel – add “states” to represents the generic states of the system
Recommended