Page 1
Multistage Methods for Freight Train Classification
Riko Jacob, Peter Marton, Jens Maue, Marc Nunkesser
Institute of Theoretical Computer Science, ETH Zurich
ATMOS 2007 - 16 November 2007
Jens Maue (ETH) Multistage Train Classification ATMOS-07 1 / 14
Page 2
Introduction
Train Classification
Train classification≈
Sorting railway cars
I multi-destination freight trains
I cars ordered according to destinations
I infrastructure: hump yard
I method: multistage sorting
Jens Maue (ETH) Multistage Train Classification ATMOS-07 2 / 14
Page 3
Introduction
Outline
Introduction
ModelClassification YardClassification Process
Optimal SchedulesSchedule RepresentationOptimal Schedules
Further Results
Concluding Remarks
Jens Maue (ETH) Multistage Train Classification ATMOS-07 3 / 14
Page 4
Model Classification Yard
Hump Yard
hump
track
hump
classification tracks
ladder
General layout:
I hump track with hump
I ladder: tree of switches
I dead-ended classification tracks
Jens Maue (ETH) Multistage Train Classification ATMOS-07 4 / 14
Page 5
Model Classification Process
Example
5
3
2
4
1
6
θ1θ2θ3θfin
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 6
Model Classification Process
Example
θ1θ2θ3θfin
1 5 3 6
4
2
5
3
2
4
1
6
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 7
Model Classification Process
Example
θ1θ2θ3θfin
1 5 3 6
4
2
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 8
Model Classification Process
Example
θ1θ2θ3θfin
2
4
6
6
4
2
1 5 3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 9
Model Classification Process
Example
θ1θ2θ3θfin
2
4
6
1 5 3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 10
Model Classification Process
Example
θ1θ2θ3θfin
6
4
2
1 5 3
2 6 4
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 11
Model Classification Process
Example
2
1θ1θ2θ3θfin
4
3
6
5
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 12
Model Classification Process
Example
θ1θ2θ3θfin
2
1
6
5
4
3
4
3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 13
Model Classification Process
Example
θ1θ2θ3θfin
4
3
2
1
6
5
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 14
Model Classification Process
Example
θ1θ2θ3θfin
6
5
4
3
2
1
4
3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 15
Model Classification Process
Example
1
2
3
4
θ1θ2θ3θfin
5
6
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 16
Model Classification Process
Example
θ1θ2θ3θfin
5
6
5
6
2
1
4
3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 17
Model Classification Process
Example
θ1θ2θ3θfin
5
6
2
1
4
3
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 18
Model Classification Process
Example
θ1θ2θ3θfin
5
6
2
1
4
3
5
6
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 19
Model Classification Process
Example
6
5
4
3
2
1θ1θ2θ3θfin
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 20
Model Classification Process
Example
6
5
4
3
2
1θ1θ2θ3θfin
Multistage Train Classification:
1. start: roll-in input train
2. alternately pull out and roll in
3. finish: ordered train on any track
Jens Maue (ETH) Multistage Train Classification ATMOS-07 5 / 14
Page 21
Optimal Schedules Schedule Representation
Classification Schedules
001101
010100
100001
532416
Classification schedule representation:
I efficient encoding
I applies to existing methods
I prove properties of methods
I derive optimal schedules
Efficient schedule representation:
I bitstring encodes journey of car
I logical order of tracks
I minimize length: no. of pull-out steps
Jens Maue (ETH) Multistage Train Classification ATMOS-07 6 / 14
Page 22
Optimal Schedules Schedule Representation
Classification Schedules
θ1θ2θ3θfin
1 5 3 6
4
2
5
3
2
4
1
6
001101
010100
100001
532416
Classification schedule representation:
I efficient encoding
I applies to existing methods
I prove properties of methods
I derive optimal schedules
Efficient schedule representation:
I bitstring encodes journey of car
I logical order of tracks
I minimize length: no. of pull-out steps
Jens Maue (ETH) Multistage Train Classification ATMOS-07 6 / 14
Page 23
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
5
3
2
4
1
6
θ1θ2θ3θfin
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 24
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
5
3
2
4
1
6
θ1θ2θ3θfin
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 25
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
θ1θ2θ3θfin
1 5 3 6
4
2
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 26
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
2
1θ1θ2θ3θfin
4
3
6
5
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 27
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
1
2
3
4
θ1θ2θ3θfin
5
6
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 28
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
6
5
4
3
2
1θ1θ2θ3θfin
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 29
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
6
5
4
3
2
1θ1θ2θ3θfin
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 30
Optimal Schedules Schedule Representation
Valid Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi < bj ⇒ τi goes to output track before τj does
Proof.Let bi
` = 0 < 1 = bj` and bi
k = bjk for all k > `.
Consider `-th pull-out: τi goes to track of τj .
TheoremTrain of n cars has valid schedule of length h = dlog2 ne.
Considering structure of input improves schedule!
6
5
4
3
2
1θ1θ2θ3θfin
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 7 / 14
Page 31
Optimal Schedules Optimal Schedules
Optimal Schedules
Consider presortedness of input to get optimal schedule:
DefinitionGiven a train Tin = τ1 . . . τn, a subsequence T ′ = τi1 . . . τim
of Tin is called a chain if τij+1= τij + 1 and T ′ maximal.
Example
Three chains: c1 = [1, 2, 3], c2 = [4, 5], and c3 = [6].
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 8 / 14
Page 32
Optimal Schedules Optimal Schedules
Optimal Schedules
Consider presortedness of input to get optimal schedule:
DefinitionGiven a train Tin = τ1 . . . τn, a subsequence T ′ = τi1 . . . τim
of Tin is called a chain if τij+1= τij + 1 and T ′ maximal.
Example
Three chains: c1 = [1, 2, 3], c2 = [4, 5], and c3 = [6].
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 8 / 14
Page 33
Optimal Schedules Optimal Schedules
Optimal Schedules
Consider presortedness of input to get optimal schedule:
DefinitionGiven a train Tin = τ1 . . . τn, a subsequence T ′ = τi1 . . . τim
of Tin is called a chain if τij+1= τij + 1 and T ′ maximal.
Example
Three chains: c1 = [1, 2, 3], c2 = [4, 5], and c3 = [6].
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 8 / 14
Page 34
Optimal Schedules Optimal Schedules
Optimal Schedules
Consider presortedness of input to get optimal schedule:
DefinitionGiven a train Tin = τ1 . . . τn, a subsequence T ′ = τi1 . . . τim
of Tin is called a chain if τij+1= τij + 1 and T ′ maximal.
Example
Three chains: c1 = [1, 2, 3], c2 = [4, 5], and c3 = [6].
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 8 / 14
Page 35
Optimal Schedules Optimal Schedules
Optimal Schedules
Consider presortedness of input to get optimal schedule:
DefinitionGiven a train Tin = τ1 . . . τn, a subsequence T ′ = τi1 . . . τim
of Tin is called a chain if τij+1= τij + 1 and T ′ maximal.
Example
Three chains: c1 = [1, 2, 3], c2 = [4, 5], and c3 = [6].
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 8 / 14
Page 36
Optimal Schedules Optimal Schedules
Optimal Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi = bj , then τi and τj never swap relative order.
TheoremTrain of c chains has optimal schedule of length dlog2 ce.
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 9 / 14
Page 37
Optimal Schedules Optimal Schedules
Optimal Schedules
Given:
I input train Tin = τ1 . . . τn
I classification schedule B = (b1, . . . , bn)
Observation:
I bi = bj , then τi and τj never swap relative order.
TheoremTrain of c chains has optimal schedule of length dlog2 ce.
2
5
4
1
3
6
Jens Maue (ETH) Multistage Train Classification ATMOS-07 9 / 14
Page 38
Further Results
Problem Variants
Input/output specification:
I multiple output trains: essentially same problem
I multiple input trains: minimize number of chains
Restricted yard:I classification tracks of restricted capacity: NP-hard
I special case single-car chains: optimal polynomial algorithm
I bounded number of tracks: optimal polynomial algorithm
Jens Maue (ETH) Multistage Train Classification ATMOS-07 10 / 14
Page 39
Further Results
Problem Variants
Input/output specification:
I multiple output trains: essentially same problem
I multiple input trains: minimize number of chains
Restricted yard:I classification tracks of restricted capacity: NP-hard
I special case single-car chains: optimal polynomial algorithm
I bounded number of tracks: optimal polynomial algorithm
Jens Maue (ETH) Multistage Train Classification ATMOS-07 10 / 14
Page 40
Concluding Remarks
Conclusion
Multistage train classification:
I derive set of bitstrings
I meet restrictions of problem variant
I restrictions affect complexity θ1θ2θ3θfin
1 5 3 6
4
2
5
3
2
4
1
6
001101
010100
100001
532416
Jens Maue (ETH) Multistage Train Classification ATMOS-07 11 / 14
Page 41
Concluding Remarks
Future work
Further variants and practical application:
I more general output train
I other objectives
I time-dependent input and robustness
I simulation for real-world yard
Jens Maue (ETH) Multistage Train Classification ATMOS-07 12 / 14
Page 42
Concluding Remarks
Future work
Further variants and practical application:
I more general output train
I other objectives
I time-dependent input and robustness
I simulation for real-world yard
Jens Maue (ETH) Multistage Train Classification ATMOS-07 12 / 14
Page 43
Concluding Remarks
Future work
Further variants and practical application:
I more general output train
I other objectives
I time-dependent input and robustness
I simulation for real-world yard
Jens Maue (ETH) Multistage Train Classification ATMOS-07 12 / 14
Page 44
Concluding Remarks
Future work
Further variants and practical application:
I more general output train
I other objectives
I time-dependent input and robustness
I simulation for real-world yard
Jens Maue (ETH) Multistage Train Classification ATMOS-07 12 / 14
Page 45
Concluding Remarks
Simulation for Real-World Yard: Lausanne Triage
Infrastructure and operation:
I two parallel humps
I time windows for multistage classification
I local freight trains (about 400 cars per day)
Jens Maue (ETH) Multistage Train Classification ATMOS-07 13 / 14
Page 46
Concluding Remarks
Future work
Further variants and practical application:
I more general output train
I other objectives
I simulation for real-world yard
I time-dependent input and robustness
Jens Maue (ETH) Multistage Train Classification ATMOS-07 14 / 14
Page 47
References
Jacob, R., Marton, P., Maue, J., and Nunkesser, M. (2007).Multistage methods for freight train classification.In Proc. of the 7th Workshop on Algorithmic Methods and Models forOptimization of Railways (ATMOS-07), DROPS, pages 158–174. IBFISchloss Dagstuhl.
Jens Maue (ETH) Multistage Train Classification ATMOS-07 14 / 14