Date post: | 17-Dec-2015 |
Category: |
Documents |
Upload: | bathsheba-ramsey |
View: | 219 times |
Download: | 6 times |
An Introduction to Max-plus Algebra
Hiroyuki GotoDepartment of Industrial & Systems Engineering
Hosei University, Japan
Outline of Today's TutorialPart I. IntroductionWhy max-plus algebra?What is max-plus algebra?How to use?
Part II. Relevant TopicsWhere is max-plus algebra?Relevance with close fields• Control theory, graph theory, discrete mathematics
Part III. Miscellaneous Topics & Recent AdvancesExtensions to wider classesExtension stochastic systems
2
Part I. Introduction
3
Why Max-Plus Algebra?Simple Scheduling Problem based on PERT
• PERT: Performance Evaluation and Review Technique
Project with four activities
4
Activity
Days
Predecessors
A dA --
B dB A
C dC A
D dD B, C
AOA (Activity on Arrow) Earliest node times
AON (Activity on Node)
1
2
4
3
AdA C
dC
B
dB DdD
,23 Cdxx ,1 ux ,12 Adxx ),,max( 324 xdxx B ,45 Ddxx
5xy
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
Start Finishevent/state
Earliest Node TimesDerive an explicit form
5
,1 ux ,12 Adxx ,23 Cdxx
,45 Ddxx ),,max( 324 xdxx B
5xy
DCBA
CBA
CA
A
dddd
ddd
dd
d
u
u
u
u
u
x
x
x
x
x
),max(
),max(
0
5
4
3
2
1
DCBA dddduxy ),max(5
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
Eliminate xi on the right hand-side
Lapse of time: '+' operationSynchronization: 'max' operation
Completion (output) time
Latest Node TimesCalculate the times from downstream to upstream
Slack time (margin)
Critical path 6
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
,54 Ddxx
,043 xx
),,min( 432 BC dxdxx ,21 Adxx
yx 5
Eliminate xi using
0
),max(
),max(
5
4
3
2
1
D
D
CBD
ACBD
d
d
ddd
dddd
y
y
y
y
y
x
x
x
x
x
),max(),min( baba
0
)0,max(
)0,max(
0
45
23
24
12
CB
BC
D
C
B
A
D
C
B
A
dd
dd
dxx
dxx
dxx
dxx
f
f
f
fWijW dxxf
A, D, and (B or C)
Features of PERTTraditional PERT can describePrecedence relationships between activitiesDuration time of each activity
Limitation: cannot describe other practical constraints such asA single worker (resource) is assigned to multiple activities
The facilities (resources) process the same job repeatedly
Resource conflict may occur, etc.
7
Modeling and analysis method using max-plus algebra is an useful alternative approach
What is max-plus algebra?Basic operations
8
}{max RR),max( yxyx
yxyx Addition:
Multiplication: max, Ryx
Priorities of operators: '*' > '+' (same as conventional algebra)
Subtraction ‘-’ and division '/' : not defined directly
Zero element: xxx xxeex
)( )0( eUnit element:
0
1
•Examples5)3,5max(35
5),5max(5 )(44
3303 e83535
81795
Correspond to)0log( )1log( e
‘O-plus’
‘O-times’
Behavior of a Production System
Production system with 3 machines
9
Non-concurrency = each machine cannot process multiple materials at the same time
ix
iu
: Job number
: Material feeding time in input iy : Finish time
Earliest processing start times / output time)}1(),(max{)( 1111 kxkudkx
)}1(),(max{)( 2222 kxkudkx
)}1(),(),(max{)( 32133 kxkxkxdkx
)()( 3 kxky
Lapse of time: '+' operationSync., non-concurrency: 'max'
kM1
M2
M3
1x
1d
2x
2d
1u
2u
y3x
3d
: Completion time in machine i
Matrix OperationsSame rules as conventional algebra
10
ijijij ][][][ YXYX
}][]{[max][][][1
ljill
ljil
n
lij ZXZXZX
Addition:
Multiplication:
nm max, RYX
Zero matrix:εeUnit matrix:
pn maxRZ
All elements are e
Diagonal elements: e, off-diagonal elements: e
n
lljilij
1
][][][ ZXZXijijij ][][][ YXYX
•Examples
143
111
21131213
1111
1
111
23
eee
23
11
213
111
1
111
23
eee
Matrix Representation (1)Earliest node times of the four-activity project
11
u
e
d
ed
d
d
D
B
C
A
xx
bxAx
Initial stateDummy task (synchronization)
Linear form in max-plus algebra:
Precedence relations & elapsed times
⇒ MPL (Max-Plus Linear) form
,1 ux ,12 Adxx ,23 Cdxx
,45 Ddxx ),,max( 324 xdxx B
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
5xy xy e
Matrix Representation (2)Earliest schedule of the three-machine production system
12
})(,)1(max{)( 11111 dkudkxkx })(,)1(max{)( 22222 dkudkxkx
})1(,)(,)(max{)( 3332313 dkxdkxdkxkx
)()( 3 kxky
)()1()()( 2
1
3
2
1
33
kd
d
k
d
d
d
k
dd
k uxxx
External inputs
)()1()()( kkkk uBxPxFx MPL form:
Non-concurrencyPredecessors
)()( kek xy
1
2
3
1x
1d2x
2d
1u
2u
y3x
3d
How to Solve the Equation?Substitute iteratively
13
bxAx bxAx bAx 1)( I
bbxAA )(
bAAexA )( 23
bAexA )(2
bAAAexA )( 12 ss
bAbAAAe *12 )( s
If the precedence relationships are represented by a DAG (Directed Acyclic Graph),
Cf. In conventional algebra,
)1(, 1 nsss εAεA (nilpotent)
Kleene Star (Closure)
Interpretation of the Representation
MatrixSolution of the recursive linear equation
14
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
bxAx
bAx *
A: precedence relationsb: start time
j: source node
: earliest arrival times between two nodes = longest paths
eddddddddd
eeddddd
eddd
ed
e
DDDCBDCBA
CBCBA
CCA
A
)()(
)(
*A
i: destination node
Output timexCy eC : final node
u
e
d
ed
d
d
D
B
C
A
bA ,
Earliest Times of the Production System
Earliest times of the system with 3 machines
15
)()1()()( kkkk uBxPxFx
2
1
3
2
1
33
,, d
d
d
d
d
dd
BPF
)]()1([)( * kkk uBxPFx
3231
2
1*
33231
2
1* ,
dddd
d
d
ddddd
d
d
BFPF
1
2
3
1x
1d2x
2d
1u
2u
y3x
3d
)()( kk xCy
bxAx
bAx *
: earliest processing times between two nodes
: earliest processing times from the external inputs
Focusing on the Latest TimeLatest node times of the four-activity project
16
,54 Ddxx ,043 xx
),,min( 432 BC dxdxx ,21 Adxx
yx 5'min' and '-' operators appear
)][][(min][ ljill
ij YXYX
y
ed
d
e
dd
d
D
D
BC
A
xx
e
d
ed
d
d
D
B
C
A
CA ,
yCxA TT
)][,]min([][][ ijijijij YXYX Min.: Pseudo division:
Solution of the Recursive Equation
Solve (a kind of) recursive linear equationLatest times
17
dxAx T bxAx
bAx *dAx T*
yCxAx TT
ZXYZYX TTT )()(
Cf. Earliest times
e
d
d
ddd
dddd
y
D
D
DCB
DCBA
TTT
)(
)(
)()( ** yACyCA
1 2 4
3
5
C dC
A
dA
B
dB
D
dDu y
: the same as p.5
Part II. Relevant Topics
18
Relevant FieldsModern control theoryState monitoring and control of systems• Control input: start time of a job • Control output: end time of a job• State variable: event occurrence time• System parameter: duration time
Petri netRepresentation of the behavior of event-driven systems• Structure: synchronization, parallel processing, etc.• Place: conditions for event occurrence (non-concurrency,
capacity)• Transition: event occurrence, start/completion of an event • Arc: precedence constraint, sequence of events• Marking: system’s state 19
Relevance with Modern Control Theory
Earliest schedule for the 3-machine production system
20
)()()( ttt BuAxx )()( tt Cxy )()( kk xCy
Cf.)()1()( kkk uBxAx
Generalized representation
Same form as the state-space representationSome methods in modern control theory can be applied• Internal model control, model predictive control, adaptive
control, etc.
)]()1([)( * kkk uBxPFx )()( kk xCy
Relevance with Petri netBehavior of TEGs: expressed by an MPL formTEG: Timed Event GraphAll places have one input and one output transitions
21
M1
M2
M3
1x
1d2x
2d
1u
2u
y3x
3d
y
1x
2x
1u
2u
3x
1d
2d
3dCapacity of placesInternal: 1External: +Inf
Capacity=1
Capacity=+Inf
Ultra-discretization (1)Ramp function
22
)0(0
)0()(
x
xxxR
u
uxxS
)]0exp()ln[exp()(
x
y
O
)(xRy 0)0,max( xx
)(
)(
u
xR
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.60
0.5
u=1u=5u=10R(x)
x
y
max operation is related to exp and log functions
Ultra-discretization (2)Variable transformation
Addition
Multiplication
Zero & unit elements• Zero element:• Unit element:
23
)exp(),exp(),exp( uYzuYyuXx
and let (ultra-discretization)u
yxz )exp()exp()exp( uYuXuZ
u
eeZ
uYuX
u
)ln(lim
yxz
YXYX ),max(
)exp()exp()exp( uYuXuZ
u
eeZ
uYuX
u
)ln(lim
YXYX
Xx ,00,1 Xx
Semiring & DioidSemiringCommutative law:Associative laws:Distributive laws:
Three axioms for e and e:
Dioid (idempotent semiring)+Idempotency
24
),,( D
),()( zyxzyx
xyyx
)()( zyxzyx
)()()( zyzxzyx ),()()( zxyxzyx
,xxx ,xxeex ex
Dzyx ,,
xxx (does not hold in usual algebras)
),,( D is a semiring
is a Dioid
Some Classes of Dioid
Max-plus algebra:Max-times algebra:Min-max algebra:Min-plus algebra:Boolean algebra:
25
),(
)1,0(
),max,],1,0([
),( e),max,},{( R )0,(
),,( D
)1,0(
max),min,},{( R
)0,(min),},{( R
min),max,},1,0({
xxx
Note:These are widely referred to as *** algebra,but are not an algebra in a strict sense because of
Communication GraphState transition graph of a representation matrixNode: state (of jobs, facilities)Weight of an edge: transition time
Example
26
,
3
57
4
A
1 3
2
7
4 5
43
810
92A
,
12
3
A
4A: Reachable with k steps from j -> i maximum cumulative weight
ijk ][ A
Eigenvalue problem
Num. eigenvalues of square matrices: n or smaller
27
ee1
2
1
ee
2
2
1
e
eeee
1
1
111
eeee
xxA
1 2
1 2
1 2
0 1
0,
3
2,
2
1,
1
e
These are all eigenvectors-> indeterminacy for constant offsets(Set e for the minimum non-e element)
Eigenvalue of a reduced matrixOnly one eigenvalueMaximum average cumulative weight among all cyclesAll elements of eigenvectors are non-e
28
ee
5.25.4
5.2
42
73
ee
14
1
42
53
ee
13
1
22
33
l
w
ACp p
p
||
||max
)(
p
wp ||
lp ||
: Path of the cycle: Weight of the path: Length of the path
1 2
3 42
7
1 2
3 42
5
1 2
3 2
3
2
)(AC : Cycle in Graph A
Kleene Star In Max-Plus AlgebraAlso referred to as the Kleene ClosureCollection of symbols of generated by arbitrary repetitions of an operation
In Max-plus algebra
longest paths for all node pairs
29
l
l
AAAeA0
2*
ij][ *A ≠ e : maximum cumulative weights from node j -> i= e : not reachable from node j -> i
e
e
e
e
3812
59
4*
A
1 3
2
7
4 5
43
3
57
4A
(p.25)
Kleene Star In Some Classes
Directed Acyclic Graph (DAG)Today's main target • There is no path with s steps or greater
Connected graph with non-positive maximum circuit weight• Any non-positive circuit cannot be the longest path
30
ls
l
A
0
l
l
AAAeA0
2*
(finite number of terms)
εA l ),( slns
),( slns ls
l
l
AA0
Part III. Miscellaneous Topics & Recent
Advances
31
Tetris-Like ScheduleEarliest schedule of 3 blocks
32
: Block (job) numberk
ix: Upper-end position of resource i
}2)1(,1)1(max{)( 322 kxkxkx
}3)1(,2)1(max{)( 323 kxkxkx
)1()(),1()(),1()( 554411 kxkxkxkxkxkx
}),()1({max)( jijj
i lukxkx
ii lu , : relative upper-/lower- end positions of resource i
)1()( kxkx ii : Resource i is not used
Lapse of time: '+'Non-concurrency: 'max'
k-1
Resource 1 2 3 4 5
k
Block = relative times are fixed
Pre- and post- processing tasks
Facility interference
Matrix RepresentationEarliest times of the Tetris type schedule
33
)1(32
21
)(
k
e
e
e
k xx
)1()( kk xMxMPL form:
}2)1(,1)1(max{)( 322 kxkxkx
}3)1(,2)1(max{)( 323 kxkxkx
)1()( 11 kxkx
)1()( 44 kxkx
1 2 3 4 5
)1()( 55 kxkx
Non-diagonal: completion time in i – start time in j
Diagonal: block depth
k
1k
Duality & Dual SystemEarliest timesState equation
• gives the earliest completion timesOutput equation
• gives the earliest output times
Latest times
• Latest start times
• Latest input times
34
)]()1([)( 0 kkk uBxAx
)()( 0 kk xCy
)]()1([)( 0 kkk TT uCxAx
)()( 0 kk T xBy
PFPA *0 )(
0B
0C
0F
: Input matrix e/e
: Output matrix e/e
: Adjacency matrix e/e
Pls. refer to Ref. [1] for details
)](diag[ kdP
Connected = eNot connected = e
Transition matrix
Consideration of Capacity Constraints
Assumptions so far• Number of jobs that can be processed simultaneously in a
facility = 1• Number of maximum jobs that can exist between two facilities =
+Inf
Consideration of maximum capacity• Specify maximum capacity between two arbitrary nodes
Representation of lag times
35
)]()1([)( 0 kkk uBxAx
)()( 0 kk xCy
PFPA *0 )(
1 2 3
5
)()()( 0)(
01
* khkk hQ
hk uBxHFx
)(
)()(
k
kk
x
xx
*
0*
0
0*
0*
012
1
*
)()(
)()(
PFPPF
FPFPFFF l
k
s
lk
)()( 0 kk xCy Lag time
Ref. [2]
Application to Model Predictive Control
Substitute iteratively to the state equation
Output prediction equation
36
)()1()( kkk BuAxx
)1()()1()1( 2 kkkk BuABuxAx
)1()()1()1( 1 NkkkNk NN BuuBAxAx
)()1()( kkk ΔUΦxY
)1(
)1(
)(
)(
Nk
k
k
k
y
y
y
y
)1(
)1(
)(
)(
Nk
k
k
k
u
u
u
U
1
2
NCA
CA
CA
Φ
CABBCABCA
ε
CABBCA
εεCAB
Δ
21
2
NN
Case of production systems:Problems to determine proper material feeding times by giving due dates
Ref. [3]
)()( kk xCy
Efficient Calculation of the Kleene Star
Time complexity with a naïve method: Efficient Algorithms:1. Topological sort• Based on Depth First Search (DFS) • If the precedence relations are given by an adjacency matrix:• If given by a list:
2. Iterative update of the longest paths• Starting from a unit matrix e , procedures similar to the
elementary transformation are performed
37
)( 4nO Refs. [4], [5]
))(( mnnO n: Num. nodesm: Num. edges
)( 2nO
)( mnO
1 2 3
5 6
4
7
1 2 35 64 7
)( mnO
Extension to Stochastic Systems
Tandem structureDistribution function of summation
• Asymptotically -> central limit theorem
Fork structure (synchronization)Distribution of max.
• Only Weibull distr. (incl. exponential distr.) and Gumbell distr. (incl. double-exponential) are simple, while others are complex
Hard to handle analytically for general cases!• Numerical computations for only small-sized systems are
achieved38
1 2
12
t
dftftf0 2112 )()()(
)(1 tf )(2 tf
t t
)(12 tf
t
)]()([)( 2112 tFtFdt
dtf
tdttftF
0)()(
Another Approach to Stochastic
SystemsUtilize the framework of the Critical Chain Project Management (CCPM) Method• High uncertainty in the execution time of tasks • Detailed probability distribution is not considered
Affinity with max-plus algebra because of the same formulation framework as project scheduling problem
39
Outline of CCPMCurtail (cut) the margin time of each task
Redistribute (paste) the curtailed times to critical points• Insert time buffers
t
)(tf
HP(Highly Possible)90%
ABP(Aggressive But Possible)
50%
Ref. [6]
Insertion of Time BuffersPre-processingCurtail the margin timesIdentify critical or non-critical
Feeding bufferInsert just on the eve of critical -> non-critical points • 1/2 of the cumulative weights
of the non-critical chain
40
Project bufferInsert just before the output• 1/2 of the cumulative weights of the critical chain
Effective for both reducing the lead time and avoid delay for the due date
1 2 3
4
1 2 3
4
P
F
Thank you for listening!
41
Reference BooksMax-plus algebraF. Baccelli, G. Cohen, G.J. Olsder, and J.P. Quadrat, Synchronization and Linearity, John Wiley & Sons, New York, 1992.• Now out of print: can be downloaded via: http://maxplus.org
B. Heidergott, G.J. Olsder, and L. Woude, Max Plus at Work: Modeling and Analysis of Synchronized Systems, Princeton University Press, New Jersey, 2006.
Critical Chain Project ManagementP.L. Leach, Critical Chain Project Management, Second Edition, Artech House, London, 2005.
42
Reference Articles[1] H. Goto, ''Dual Representation of Event-Varying Max-Plus Linear Systems'',
International Journal of Computational Science, vol. 1, no.3, pp.225-242, 2007.
[2] H. Goto, ''Dual Representation and Its Online Scheduling Method for Event-Varying DESs with Capacity Constraints," International Journal of Control, vol.81, no.4, pp.651-660, 2008.
[3] H. Goto, "A Lightweight Model Predictive Controller for Repetitive Discrete Event Systems", Asian Journal of Control, vol. 15, no.4, pp.1081-1090, 2013.
[4] H. Goto, "A Fast Computation for the State Vector in a Max-Plus Algebraic System with an Adjacency Matrix of a Directed Acyclic Graph," Journal of Control, Measurement, and System Integration, vol.4, no.5, pp.361-364, 2011.
[5] H. Goto and H. Takahashi, "Fast Computation Methods for the Kleene Star in Max-Plus Linear Systems with a DAG Structure," IEICE Transactions on Fundamentals, vol.E92-A, no.11, pp.2794-2799, 2009.
[6] H. Goto, N. T. N. TRUC, and H. Takahashi, "Simple Representation of the Critical Chain Project Management Framework in a Max-Plus Linear Form", Journal of Control, Measurement, and System Integration, vol.6, no.5, pp.341-344, 2013.
43