View
5
Download
0
Category
Preview:
Citation preview
An Introduction to Max-plus Algebra
Hiroyuki Goto Department of Industrial & Systems Engineering
Hosei University, Japan
Outline of Today's Tutorial
Part I. Introduction
Why max-plus algebra?
What is max-plus algebra?
How to use?
Part II. Relevant Topics
Where is max-plus algebra?
Relevance with close fields
• Control theory, graph theory, discrete mathematics
Part III. Miscellaneous Topics & Recent Advances
Extensions to wider classes
Extension stochastic systems
1
Part I. Introduction
2
Why Max-Plus Algebra?
Simple Scheduling Problem based on PERT • PERT: Performance Evaluation and Review Technique
Project with four activities
3
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)
A
dA C
dC
B
dB D
dD
,23 Cdxx ,1 ux ,12 Adxx
),,max( 324 xdxx B ,45 Ddxx
5xy C dC
A
dA
B
dB
D
dD
u y
Start Finish event/state
Earliest Node Times
Derive an explicit form
4
,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
C dC
A
dA
B
dB
D
dD u y
Eliminate xi on
the right hand-side
Lapse of time: '+' operation Synchronization: 'max' operation
Completion (output) time
Latest Node Times
Calculate the times from downstream to upstream
Slack time (margin)
Critical path 5
C dC
A
dA
B
dB
D
dD u 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
f
WijW dxxf
A, D, and (B or C)
Features of PERT
Traditional PERT can describe
Precedence relationships between activities
Duration time of each activity
Limitation: cannot describe other practical constraints such as
A single worker (resource) is assigned to multiple activities
The facilities (resources) process the same job repeatedly
Resource conflict may occur, etc.
6
Modeling and analysis method using max-plus algebra is an useful alternative approach
What is max-plus algebra?
Basic operations
7
}{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
•Examples
5)3,5max(35
5),5max(5
)(44
3303 e
83535
81795
Correspond to
)0log(
)1log( e
‘O-plus’ ‘O-times’
Behavior of a Production System
Production system with 3 machines
8
Non-concurrency = each machine cannot process multiple materials at the same time
ix
iu
: Job number
: Material feeding time in input i
y : 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: '+' operation Sync., non-concurrency: 'max'
k M1
M2
M3
1x
1d
2x
2d
1u
2u
y3x
3d
: Completion time in machine i
Matrix Operations
Same rules as conventional algebra
9
ijijij ][][][ YXYX
}][]{[max][][][1
ljill
ljil
n
l
ij ZXZXZX
Addition:
Multiplication:
nm max, RYX
Zero matrix: ε
eUnit matrix:
pn maxRZ
All elements are
Diagonal elements: e, off-diagonal elements:
n
l
ljilij
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
10
u
e
d
ed
d
d
D
B
C
A
xx
bxAx
Initial state Dummy 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
C dC
A
dA
B
dB
D
dD
u y
5xy
xy e
Matrix Representation (2)
Earliest schedule of the three-machine production system
11
})(,)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-concurrency Predecessors
)()( kek xy
1
2
3
1x
1d
2x
2d
1u
2u
y3x
3d
How to Solve the Equation?
Substitute iteratively
12
bxAx bxAx
bAx1)( 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 Matrix
Solution of the recursive linear equation
13
C dC
A
dA
B
dB
D
dD u y
bxAx
bAx *
A: precedence relations b: 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 time
xCy 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
14
)()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
1d
2x
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 Time
Latest node times of the four-activity project
15
,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 equation
Latest times
16
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
C dC
A
dA
B
dB
D
dD u y
: the same as p.5
Part II. Relevant Topics
17
Relevant Fields
Modern control theory
State 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 net
Representation 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
18
Relevance with Modern Control Theory
Earliest schedule for the 3-machine production system
19
)()()( ttt BuAxx
)()( tt Cxy )()( kk xCy Cf.
)()1()( kkk uBxAx
Generalized representation
Same form as the state-space representation
Some 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 net
Behavior of TEGs: expressed by an MPL form
TEG: Timed Event Graph
All places have one input and one output transitions
20
M1
M2
M3
1x
1d
2x
2d
1u
2u
y3x
3d
y
1x
2x
1u
2u
3x
1d
2d
3dCapacity of places Internal: 1 External: +Inf
Capacity=1
Capacity=+Inf
Ultra-discretization (1)
Ramp function
21
)0(0
)0()(
x
xxxR
u
uxxS
)]0exp()ln[exp()(
x
y
O
)(xRy 0)0,max( xx
)(
)(
u
xR
0
0.5
-1 -0.5 0 0.5
y
x
u=1
u=5
u=10
R(x)
max operation is related to exp and log functions
Ultra-discretization (2)
Variable transformation
Addition
Multiplication
Zero & unit elements • Zero element:
• Unit element: 22
)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 ,0
0,1 Xx
Semiring & Dioid
Semiring
Commutative law:
Associative laws:
Distributive laws:
Three axioms for e and :
Dioid (idempotent semiring)
+Idempotency
23
),,( 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:
24
),(
)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 Graph
State transition graph of a representation matrix
Node: state (of jobs, facilities)
Weight of an edge: transition time
Example
25
,
3
57
4
A
7
4 5
3
810
9
2A
,
12
3
A
4A
: Reachable with k steps from j -> i maximum cumulative weight
ij
k ][ A
Eigenvalue problem
Num. eigenvalues of square matrices: n or smaller
26
ee1
2
1
ee
2
2
1
ee
eee
1
11
11
eeee
xxA
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- element)
Eigenvalue of a reduced matrix
Only one eigenvalue
Maximum average cumulative weight among all cycles
All elements of eigenvectors are non-
27
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
3 4 2
7
3 4 2
5
3 2
3
2
)(AC : Cycle in Graph A
Kleene Star In Max-Plus Algebra
Also referred to as the Kleene Closure
Collection of symbols of generated by arbitrary repetitions of an operation
In Max-plus algebra
longest paths for all node pairs
28
l
l
AAAeA0
2*
ij][ *A ≠ : maximum cumulative
weights from node j -> i
= : not reachable from node j -> i
e
e
e
e
3812
59
4*
A
7
4 5
3
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
29
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
30
Tetris-Like Schedule
Earliest schedule of 3 blocks
31
: Block (job) number k
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 Representation
Earliest times of the Tetris type schedule
32
)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 System
Earliest times
State equation
• gives the earliest completion times
Output equation
• gives the earliest output times
Latest times
• Latest start times
• Latest input times
33
)]()1([)( 0 kkk uBxAx
)()( 0 kk xCy
)]()1([)( 0 kkk TTuCxAx
)()( 0 kk TxBy
PFPA *
0 )(
0B
0C
0F
: Input matrix e/
: Output matrix e/
: Adjacency matrix e/
Pls. refer to Ref. [1] for details
)](diag[ kdP
Connected = e
Not connected =
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
34
)]()1([)( 0 kkk uBxAx
)()( 0 kk xCy
PFPA *
0 )(
1 2 3
5
)()()( 0
)(
0
1
* khkk hQ
h
k uBxHFx
)(
)()(
k
kk
x
xx
*
0
*
0
0
*
0
*
012
1
*
)()(
)()(
PFPPF
FPFPFFF
l
k
s
l
k
)()( 0 kk xCy Lag time
Ref. [2]
Application to Model Predictive Control
Substitute iteratively to the state equation
Output prediction equation
35
)()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
36
)( 4nO Refs. [4], [5]
))(( mnnO n: Num. nodes
m: Num. edges
)( 2nO
)( mnO
)( mnO
Extension to Stochastic Systems
Tandem structure
Distribution 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 achieved
37
1 2
12
t
dftftf0
2112 )()()(
)(1 tf )(2 tf
t t
)(12 tf
t
)]()([)( 2112 tFtFdt
dtf
t
dttftF0
)()(
Another Approach to Stochastic Systems
Utilize 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
38
Outline of CCPM
Curtail (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 Buffers
Pre-processing
Curtail the margin times
Identify critical or non-critical
Feeding buffer
Insert just on the eve of critical -> non-critical points
• 1/2 of the cumulative weights of the non-critical chain
39
Project buffer
Insert 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!
40
Reference Books
Max-plus algebra
F. 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 Management
P.L. Leach, Critical Chain Project Management, Second Edition, Artech House, London, 2005.
41
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. 42
Recommended