The Train Marshalling Problem Joe Ryan University of Ballarat joint work with Elias Dahlhaus, Peter Horak and Mirka Miller.

Slides:



Advertisements
Similar presentations
More Functions and Sets
Advertisements

Equivalence Relations
Covers, Dominations, Independent Sets and Matchings AmirHossein Bayegan Amirkabir University of Technology.
1 EE5900 Advanced Embedded System For Smart Infrastructure Advanced Theory.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Lecture 23. Subset Sum is NPC
1 Chapter Equivalence, Order, and Inductive Proof.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
Bundling Equilibrium in Combinatorial Auctions Written by: Presented by: Ron Holzman Rica Gonen Noa Kfir-Dahav Dov Monderer Moshe Tennenholtz.
The number of edge-disjoint transitive triples in a tournament.
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Lower Envelopes (Cont.) Yuval Suede. Reminder Lower Envelope is the graph of the pointwise minimum of the (partially defined) functions. Letbe the maximum.
HW2 Solutions. Problem 1 Construct a bipartite graph where, every family represents a vertex in one partition, and table represents a vertex in another.
Asymptotic Growth Rate
Discrete Mathematics Lecture 4 Harper Langston New York University.
CSE115/ENGR160 Discrete Mathematics 02/21/12
What is the first line of the proof? 1.If a divides b, then a divides b – c. 2.If a divides b, then a divides c. 3.Assume a divides b – c. 4.Assume a divides.
Discrete Structures Chapter 2 Part B Mathematical Induction
The Load Distance Balancing Problem Eddie Bortnikov (Yahoo!) Samir Khuller (Maryland) Yishay Mansour (Google) Seffi Naor (Technion)
Variable-Length Codes: Huffman Codes
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Ch. 8 & 9 – Linear Sorting and Order Statistics What do you trade for speed?
Chapter 6 Mathematical Induction
Discrete Mathematics, 1st Edition Kevin Ferland
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Genome Rearrangements Unoriented Blocks. Quick Review Looking at evolutionary change through reversals Find the shortest possible series of reversals.
5.6 Generating Permutations and Combinations Generating Permutations Many different algorithms have been developed to generate the n! permutations of this.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Chapter 6: Geometric Analysis: The Gap Property By azam sadeghian 1.
Restricted Track Assignment with Applications 報告人:林添進.
Approximation Schemes Open Shop Problem. O||C max and Om||C max {J 1,..., J n } is set of jobs. {M 1,..., M m } is set of machines. J i : {O i1,..., O.
Chapter 2: Probability · An Experiment: is some procedure (or process) that we do and it results in an outcome. A random experiment: is an experiment we.
Addressing and hashing Question: For a network of computers it is desirable to be able to send a message from A to B without B knowing that a message is.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
ELEMENTARY SET THEORY.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
Main Menu Main Menu (Click on the topics below) Combinatorics Introduction Equally likely Probability Formula Counting elements of a list Counting elements.
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
1 Covering Non-uniform Hypergraphs Endre Boros Yair Caro Zoltán Füredi Raphael Yuster.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
1 Chapter 2 Pigeonhole Principle. 2 Summary Pigeonhole principle –simple form Pigeonhole principle –strong form Ramsey’s theorem.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
1 Section 4.2 Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST).
Department of Statistics University of Rajshahi, Bangladesh
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
Single Machine Scheduling Problem Lesson 5. Maximum Lateness and Related Criteria Problem 1|r j |L max is NP-hard.
Dilworth’s theorem and extremal set theory 張雁婷 國立交通大學應用數學系.
CS151: Mathematical Foundations of Computing Mathematical Induction.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Approximating Set Cover
CHAPTER 2 Set Theory A B C.
Chapter 3 The Real Numbers.
Equivalence Relations
Divide both sides by 3 Add 10 to both sides Subtract 5 from both sides Multiple both sides by -2 Multiple both sides by 2 Divide both sides by -3.
9. Counting and Probability 1 Summary
3.3 Applications of Maximum Flow and Minimum Cut
CS201: Data Structures and Discrete Mathematics I
Pumping Lemma for Context-free Languages
Approximation Algorithms
Systems of distinct representations
Presentation transcript:

The Train Marshalling Problem Joe Ryan University of Ballarat joint work with Elias Dahlhaus, Peter Horak and Mirka Miller

Outline of Talk 1.Define the problem 2.TMP is NP-Complete Reduction from NMTS TMP  NMTS 3.Upper bound in terms of n 4.Conclusion

The Train Marshalling Problem The cars have different destinations, we use auxiliary rails to rearrange their order so that all cars with the same destination will be grouped together. Since, in general, there may be several trains at the station to be processed at the same time, the target is to use as few auxiliary rails as possible for each train

Station 1: Cars 1,6,11 Station 2: Cars 5,10 Station 3: Cars 3,8 Station 4: Cars 2,7 Station 5: Cars 4,9 Track A Track B Track C Track D Reassemble the train from Track D followed, in order, by tracks C, B and A.

Station 1Station 2Station 5Station 3Station 4 Train Ready to Distribute Carriages

The Train Marshalling Problem Given a partition S of { 1,…,n } into disjoint sets S 1,…,S t, find the smallest number k = K( S ) so that there exists a permutation p(1),…,p(t) of { 1,…,t } with the property: The sequence of numbers 1,2,…,n,1,2,…,n,…,1,2,…,n, where the interval 1,2,…,n is repeated k times, contains all the elements of S p(1), then all elements of S p(2),… etc., and finally all elements of S p(t).

The Train Marshalling Problem n = 11 1,2,3,4,5,6,7,8,9,10,11 S = {S 1,S 2,S 3,S 4,S 5 } S 1 = {1,6,11} S 2 = {5,10} S 3 = {3,8} S 4 = {2,7} S 5 = {4,9} k = K( S ) = , , ,

Numerical Matching with Target Sums* a 1,a 2,a 3, …,a i,…,a j,…,a k,…,a n-1,a n b 1,b 2,b 3, …,b i,…,b j,…,b k,…,b n-1,b n c 1,c 2,c 3, …,c i,…,c j,…,c k,…,c n-1,c n + = + = * Garey and Johnson:- Problem SP17

Numerical Matching with Target Sums Instance: positive integers I : a 1,a 2,…,a n,b 1,b 2,…,b n,c 1,c 2,…c n Question: Are there permutations  1 and  2 such that for all i = 1,2,…n, a  1 (i) + b  2 (i) = c i ? Restriction a i  2, b i  2, c j  b i, c j  a i + 2.

The Reduction Let a 1,a 2,…,a n,b 1,b 2,…,b n,c 1,c 2,…c n be positive integers satisfying the restrictions. Let N = n  c i. To the set (train) I N = { 1,2,…,N } we assign a partition, R, of 2n elements (destinations); S 1,…,S n,T 1,…T n. Divide the train into blocks X 1,X 2,…X n and subblocks X i = D i j, j = 1,…,c i (in order).

The Reduction For any subblock D i j, and any destination M, D i j contains either 0 or 1 car going to M. There is a car of destination S k in D i j iff j = c i − a k +1,…,c i And a car of destination T k in D i j iff j = 1,…,b k. In any subblock, cars with S destinations precede cars with T destinations and S i (T i ) precedes S j (T j ) iff i < j.

The Reduction In each block there are a i cars with destination S i and b i cars with destination T i. In each block there are  a i +  b i =  c i cars. So there are N = n  c i cars in R. The first 2 subblocks in any block contain n cars of T destinations (b i > 2) and no cars of S destinations (a i +2  c j ). The last subblock is made up of n cars of S destinations (b i < c j ).

Example Let a 1 =2,a 2 =3,a 3 =3,b 1 =3,b 2 =4,b 3 =3,c 1 =5,c 2 =7,c 3 =6. Then train R consists of N = 3(5+7+6) = 54 cars. Recall There is a car of destination S k in D i j iff j = c i −a k +1,…,c i And a car of destination T k in D i j iff j = 1,…,b k.

Example Let a 1 =2,a 2 =3,a 3 =3,b 1 =3,b 2 =4,b 3 =3,c 1 =5,c 2 =7,c 3 =6. Then train R consists of N = 3(5+7+6) = 54 cars t 1 t 2 t 3 −t 1 t 2 t 3 −s 2 s 3 t 1 t 2 t 3 −s 1 s 2 s 3 t 2 −s 1 s 2 s 3 ║t 1 t 2 t 3 −t 1 t 2 t 3 −t 1 t 2 t 3 −t 2 −s 2 s 3 −s 1 s 2 s 3 −s 1 s 2 s 3 ║t 1 t 2 t 3 −t 1 t 2 t 3 −t 1 t 2 t 3 −s 2 s 3 t 2 −s 1 s 2 s 3 −s 1 s 2 s 3 3−3−5−4−3║3−3−3−1−2−3−3║3−3−3−3−3−3 Partition is T 1 = {1,4,9,19,22,25,37,40,43} T 2 = {2,5,10,15,20,23,26,28,38,41,44,48} T 3 ={3,6,11,21,24,27,39,42,45} S 1 ={12,16,31,34,49,52} S 2 ={7,13,17,29,32,35,46,50,53} S 3 ={8,14,18,30,33,36,47,51,54}

Claim: TMP is NP-Complete K(R)  2n−1  a 1,…,a n,b 1,…,b n,c 1,…,c n have a numerical matching. (i.e.) the conditions of NMTS are satisfied.

K(R)  2n−1  NMTS We have permutations  1 and  2 satisfying NMTS and need to show K(R)  2n−1. i.e. there is an order O of the 2n destinations so that the sequence J = (2n−1)I N contains all cars of the first destination of O followed by all cars of the second etc.

K(R)  2n−1  NMTS Let O = T  2 (n),S  1 (n),T  2 (n-1),S  2 (n-1),…,T  2 (1),S  1 (1) Choose as first car of T  2 (i) on J, the car in Then the last placed car of T  2 (i) is in Choose as first car of S  1 (i) on J, the car in Then the last placed car of S  1 (i) is in

Example 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 S1S1 T1T1 S2S2 T2T2 S3S3 T3T3

K(R)  2n−1  NMTS Cars from the first destination are placed in the first round. Cars from the i-th destination are placed in the (i-1)-th round and the beginning of the i-th round. The last car of T  2 (1) is in So all the cars of S  1 (1) can be placed in the same ( 2n−1 )-th round. for this part

K(R)  2n−1  NMTS Consider the sequence J = 1,2,…,N,1,2,…,N,…,1,2,…,N (2n − 1) repetitions For destination M, let f M be the car of M placed first and l M the car of M placed last. Let J M be the interval on J from f M to l M. For each m  I N we say m is covered by M (destination) if at least 1 of the ( 2n − 1 ) occurrences of m in J belong to interval J M.

Example J T 3 = [3,45], J S 3 = [47,54]  [1,36] 4 is covered by both destinations T 3 and S 3 J T 3 covers 4 in the first round of J and J S 3 covers 4 in the second round of J. 46 is covered by neither of them. 40 is covered by T 3 but not by S 3. Each element of I N belongs to at most 2n−1 intervals.

K(R)  2n−1  NMTS Let x i = number of car of T n in D i 1 Let y i = number of car of S 1 in D i c i For i=1,..,n, x i is not covered by either i)Any T destination ( T  T n ) with f T in ii)Any S j destination with f S j in For i=1,…n, y i is not covered only by iii)Any T destination with f T in iv)Any S destination ( S  S 1 ) with f S in

Example Let x i = number of car of T n in D i 1 Let y i = number of car of S 1 in D i c i carnot covered bytype x 1 = 3S1S1 ii) x 2 = 21S2S2 ii) x 3 = 39S3S3 ii) y 1 = 16T1T1 iii) y 2 = 34T2T2 iii) y 3 = 52T3T3 iii)

K(R)  2n−1  NMTS All T destinations are of type ii) so all S destinations are of type iii). For each i there is one T with f T in X i and one S with f S in X i. Let T k be the T with f T k  X (i+1)modn Let S j be the S with f S j  X i. Then l T k < f S j. Subblock with l T k precedes subblock with f S j

K(R)  2n−1  NMTS T k does not cover the last c i −b k subblocks in X i. S j does not cover the first c i −a j subblocks in X i.

1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 TkTk SjSj c i -b k c i -a j  X1X1 T1T1 S1S1 235 X2X2 T2T2 S2S2 347 X3X3 T3T3 S3S ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54 S1S1 T1T1 S2S2 T2T2 S3S3 T3T3 3−3−5−4−3║3−3−3−1−2−3−3║3−3−3−3−3−3 a 1 = 2a 2 = 3a 3 = 3 b 1 = 3b 2 = 4b 3 = 3 c 1 = 5c 2 = 7c 3 = 6

K(R)  2n−1  NMTS T k does not cover the last c i −b k subblocks in X i. S j does not cover the first c i −a j subblocks in X i. So c i −b k +c i −a j  c i i.e. c i  a j + b k but we can set  1 (i) = j and  2 (i) = k Then we get, for i = 1,…,n, c i  a  1 (i) + b  2 (i) However we have  a i +  b i =  c i so inequality becomes equality.

Take next exitContinue

The Upper Bound Since TMP is NP-complete, an upper bound for K(S) in terms of n may be useful. (We know that for t destinations K(S)  t−1. ) Let K n be that maximum of K(S) where S ranges over all partitions of {1,…,n}. Main result for this section K n =  n/4 + ½ 

Notation For S a partition of {1,…,n}, say S = {S(1), S(2),…,S(s)}, we use S(i) to denote the set containing i. If we use a number x i, y i etc. then this number is from the same set as i. So S(i) = {i, x i, y i,…} Let T −1 be the train obtained from T by reversing the cars. Then K(T) = K(T −1 ).

Observations For S′ = {S(i 1 ),…,S(i r )} a subset of S where | S(i 1 )  …  S(i r ) | = t then K(S)  K(S′) + K(S−S′)  K(S′) + K n-t Let S contain a destination with r cars or r destinations with a single car each. Then, K(S)  1 + K n−r

Observations If all numbers of S(i) are smaller than all numbers of destination S(j) then we say that S(i) and S(j) do not overlap. If |S(i)| + |S(j)| = r and S(i) and S(j) do not overlap then K(S)  1 + K n−r

Lemma Let S(i 1 ),…,S(i k ) be destinations of S such that |S(i 1 )| + |S(i k )| = t and all the numbers of the interval {1,…,j} belong to U = S(i 1 )  …  S(i k ). If it is possible to arrange all numbers from U into k rounds so that the last ( k-th ) round contains only numbers from the interval {1,…,j} then K(S)  k−1+K n−t

K n   n/4 + ½  We may assume n  5, and that n is even. From the previous observations we have – At most one destination contains a single car. For all other destinations 2  |S(i)|  3. Any two destinations with at least 4 cars in total must overlap.

The Proof Case 1: Let |S(1)| = |S(2)| = 2, then K(S)  1+K n−4   n/4 + ½  S(1) = {1,x 1 } differs from S(2) = {2,x 2 }, then either 1, x 1, x 2, * 2 or 2, x 2, x 1, * 1. x2x2 x1x

The Proof Case 2: If one of S(1) and S(2) is of cardinality 1, then K(S)  1+K n−4   n/4 + ½  Suppose |S(1)|=1, then there is no overlap with any destination of cardinality 3. If there is no 3 car set then |S(n−1)|=|S(n)|=2 and use K( T −1 ). If |S(2)|=1 then either |S(1)|=3 whence 2,x 1,y 1,*1 Or there is |S(i)|=3 such that S(2) and S(i) do not overlap.

The Proof Case 3: Let |S(1)| = |S(2)| = 3 then either K(S)  1+K n−4   n/4 + ½  or K(S)  2+K n−8   n/4 + ½  Let S(i) be the set with the smallest index after 2. If |S(i)|=1 then the 3 sets can be placed in 2 rounds with any of 1,2,…,i in the third and use Lemma. If |S(i)|=3 then the three sets can be placed in 2 rounds with 1,2,…,i in the third and use Lemma. i 1x1x1 2x2x2 y2y2 y1y1 xixi yiyi i 2x2x2 1x1x1 y1y1 y2y2 xixi yiyi

The Proof Case 3: Let |S(1)| = |S(2)| = 3 then either K(S)  1+K n−4   n/4 + ½  or K(S)  2+K n−8   n/4 + ½  Let S(i) be the set with the smallest index after 2. If |S(i)|=2 then we can add a dummy car to S(i) and number it n+1 (it comes at the end of the train). Call this new partition S′. Then, employing the Lemma, we have K(S)  K(S′)  2+K n+1−9  2+K n−8   n/4 + ½ 

The Proof Case 4: Let |S(1)| + |S(2)| = 5, then either K(S)  1+K n−4   n/4 + ½  or K(S)  2+K n−8   n/4 + ½  Let S(1), S(2) be {a 1,a 2 }, {b 1,b 2,b 3 }, then If a 2 <b 2 <b 3 use a 1,a 2,b 2,b 3,*b 1 and the Lemma If b 2 <b 3 <a 2 use b 1,b 2,b 3,a 2,*a 1 and the Lemma If b 2 <a 2 <b 3 then 4a: consider S(j) such that |S(j)|=3 and S(j)={c 1,c 2,c 3 }. Now consider U, the union of S(1), S(2), S(j) viz, 1,2,d 3,d 4,…,d 8 (in increasing order).

The Proof 4a: We have 1<2<d 3 <d 4 <…<d 8 and a 2 = d i, i={5,6,7} The following satisfy the assumptions of the Lemma and yield the bound; If a 2 =d 7 use b 1,b 2,b 3,*c 1,c 2,c 3,a 2,*a 1 If a 2 =d 6 use c 1,c 2,c 3,b 3,*b 1,b 2,a 2,*a 1 ( 2 cases) If a 2 =d 5 use b 1,b 2,b 3,c 2,c 3,*c 1,a 2,*a 1 b 3 <c 2 <c 3 c 1,c 2,c 3,b 3,*b 1,b 2,a 2,*a 1 c 2 <c 3 <b 3 For d 5 =a 2 <c 2 <b 3 <c 3 use previous cases on S(n−1), S(n) and consider K(S −1 ).

The Proof 4b: Let S(n), S(n−1) be {u 1,u 2 }, {v 1,v 2,v 3 }. Assume there is no such S(j)={c 1,c 2,c 3 }, then {b 1,b 2,b 3 } = {v 1,v 2,v 3 }. Since n is even there must be a destination with a single car, {w}. Then either 4b1: {a 1,a 2 } = {u 1,u 2 } which gives, since the sets must overlap, {b 1,b 2,b 3 } = {1,b 2,n} so we can use w, b 2, n,* 1, or

The Proof 4b2: { a 1,a 2 }  {u 1,u 2 } then consider i){a 1,b 1 } = {1,2}, {b 3,u 2 } = {n-1,n} and u 1 <b 2 <w<a 2 ii)Same as i) with a 2 and w interchanged. Apply Lemma to S(1), S(2), {u 1,u 2 } and {w} with i)b 1,b 2,b 3,u 2,*u 1,w,a 2,*a 1 for u 2 >b 3 u 1,u 2,b 3,*b 1,b 2,w,a 2,*a 1 for u 2 <b 3 i)a 1,a 2,w,u 2,*u 1,b 2,b 3,*b 1 The proof of the statement K n   n/4 + ½  is now complete.

K n =  n/4 + ½  We present a partition showing equality. Let k =  n/2  and S = {S(1),…,S(k)} where S(i) = {i, i+k}, i = 1,…,k. Let A be an arrangement of cars in K(S) rounds of I n. Then any round contains at most 4 cars and the first round contains at most 3 cars. So K(S)   (n−3)/4+1  =  n/4 + ½ 

Conclusion A dispatcher in a marshalling yard knows that the TMP is NP-complete and that they must assume that they need min(K n,T−1) auxiliary rails ( T is the number of destinations). To improve this bound the dispatcher needs some additional information. The minimum number of cars per destination should be readily available.

Conclusion Let K(n,m) = max K(s) where the train has n cars and at least m go to any one destination. Then Conjecture: K(n,m)   (m  1)d 2 /n+1/m  where d =  n/m  Putting S(i) = {i,i+d,…,i+(m−1)d}, i = 1,…,d gives K(n,m)   (m−1)d 2 /n+1/m  where d =  n/m . So that if the conjecture is true, this bound is the best possible.

Dĕkuji