Minimum Partition Partitions of s of Minimum Integer Sequences Sequences Integer Ronny Hansmann & Uwe Zimmermann Institute for Mathematical Optimization TU Braunschweig
Basic Problem Basic Problem � The underlying problem: Given: A sequence of integers Goal: Find a Minimum Partition of the sequence into subsequences satisfying certain feasibility requirements Crucial parameters: � Integers are distinct or not distinct? � Feasibility requirements
Previous Works Works Previous � For sequences of distinct integers, i.e., permutations: � Papers on Permutations: Erdös/Szekeres 1935, Even et al 1971, Chung 1980, … � Papers on Stack Sorting: Tarjan 1972, Avis/Newborn 1981, Atkinson 2004 , … � Papers on Shunting: Winter/Zi 2000, Di Stefano/Koci 2003 , … � To be published in proceedings of LATIN 2006 : Di Stefano, Krause, Lübbecke, Zi
Theoretical Results Results for for Permutations Permutations Theoretical Feasibility requirement Complexity O ( n log n ) Isotone subsequences Even et al, 1971 N P -complete Monotone subsequences strongly Wagner, 1984 N P -complete Unimodal subsequences strongly Di Stefano, Zi, 2004 N P -complete k -modal subsequences strongly Di Stefano, Krause, Lübbecke, Zi, 2005
Practical Results Results for for Permutations Permutations Practical Exact: MIP-Modells � Set Covering Very Bad � Minimum Graph/Hypergraph-Colorings Bad � Minimum Cost Flow with GUB‘s Effective Approximations � LP-Rounding Fast Monotone subsequences: factor 2 ... k -modal subsequences: factor 2( k + 1) � Fomin et al 2002 Fast Monotone subsequences: factor 1,71
Practical Results Results for for Permutations Permutations Practical Heuristics � Greedy Very Good Online-Algorithms � No constant factor competitive online algorithms for the hard problems Bad � Next-Fit & Best-Fit: Isotone subsequences: optimal n Monotone case: -competitive (tight) 4
Not- -distinct distinct Integer Integer Sequences Sequences Not � New: Sequences of not necessarily distinct integers What is our motivation?
Practical Background Background Practical � Relate to shunting problems of our practical project (together with BASF, Ludwigshafen): � A sequence of waggons (not distinct integers) has to be stored on a minimal number of tracks in a shunting yard such they can depart as desired without shunting 1 2 3 1
Train rain S Sort ort S Shunting hunting P Problem roblem T � Basic feasibility requirement : Only complete and sorted trains (waggons of same integer value) are pulled out 1 1 1 1
Basic Notations Notations Basic � S = ( s 1 ,.. .,s n ) … sequence of n integers (waggons) � s i ∈ T = { 1 ,. ..,t } … set of t different integers (trains) � S ⊇ ( s i 1 , s i 2 , . . . , s i n ) i 1 < i 2 < · · · < i n with is called subsequence of S
Parameters Parameters � Does the order of the outgoing trains matter? � no: Non-chronological � yes: Chronological � Is there a separation between arrival and departure? � yes: Sequential � no: Concurrent ⇒ Five versions
Non on- -chronological chronological & & S Sequential equential ( (NS NS) ) N � Non-chronological: Order of outgoing trains does not matter � Sequential: First departure after last arrival 1 2 1 4 3 4 1 1 4 4 2 3 2 1 1 3 4 4 ( u,v,u ) : u 6 = v Trains u and v can not be ⇔ is a subsequence of S placed on the same track
Non on- -chronological chronological & & C Concurrent oncurrent ( (NC NC) ) N � Non-chronoligal: Order of outgoing trains does not matter � Concurrent: No separation between arrival and departure 2 1 1 4 3 4 1 2 1 4 3 4 1 4 4 3 1 2 ( u,v,u,v ) : u 6 = v Trains u and v can not be ⇔ is a subsequence of S placed on the same track
Chronological & & S Sequential equential ( (S S) ) Chronological � Chronological: Order of outgoing trains matters � Sequential: First departure after last arrival 1 2 1 4 3 4 1 1 2 4 4 3 4 4 3 2 1 1 Trains u and v can not be ( u,v ) : u < v ⇔ is a subsequence of S placed on the same track
Chronological & & C Concurrent oncurrent ( (C C) ) Chronological � Chronological: Order of outgoing trains matters � Concurrent: No separation between arrival and departure 1 2 1 4 3 4 1 1 4 3 4 2 4 4 3 2 1 1 ( u,v,w ) : w · u < v Trains u and v can not be ⇔ is a subsequence of S placed on the same track
Time ime W Windows ( indows (TW TW) ) T „forbidden“ 1 2 1 4 3 4 time 1 2 2 1 1 1 4 4 3 3 4 4 1 3 1 2 4 4 3 4 4 2 1 1
Minimum Partitions Partitions Minimum � The versions NS, S, NC, and C are equivalent to: Find a Minimum Partition of the given sequence into subsequences such that: � All elements with identical value belong to the same subsequence � If two elements s i = u and start a s j = v of S , they forbidden subsequence ( u,v,. .. ) do not both belong to the same subsequence
Minimum Partitions Partitions Minimum � The version TW is equivalent to: Find a Minimum Partition of the given set of intervals into subsets such that: � All intervals with identical end point belong to the same subset � If two intervals overlap, they do not both belong to the same subset
Graph Coloring Coloring Formulation Formulation Graph � For our problems we define a graph with vertices corresponding to the trains � We add an edge if there exists a forbidden ( u,v ) subsequence: ( u,v,u ) : u 6 = v NS ( u,v,u,v ) : u 6 = v NC ( u,v ) : u < v S ( u,v,w ) : w · u < v C or if: u = s i , v = s j : I i and I j overlap TW � Min Colorings of these graphs are optimal solutions for our problems
Time Windows vs. Sequences Sequences Time Windows vs.
Obvious Relations Relations Obvious z ∗ NS ( S I ) · z ∗ S ( S I ) S NS 1 2 1 4 3 4 1 2 1 4 3 4 1 1 1 1 4 4 2 2 3 3 4 4 TW 1 2 1 4 3 4 1 1 3 2 4 4 z ∗ NC ( S I ) · z ∗ C ( S I ) C 1 2 1 4 3 4 1 2 1 4 3 4 NC 1 4 3 4 1 1 2 1 4 3 4 2 z ∗ NS ( S I ) ≥ z ∗ z ∗ S ( S I ) ≥ z ∗ T W ( I ) ≥ z ∗ NC ( S I ) C ( S I )
Complexity Complexity O ( n 2 ) NS: O ( n log n ) S: � Graphs are perfect � Interval Coloring of P � Intervals given sorted � B EST F IT is optimal N P -complete N P -complete NC: C: � Reduction to Coloring of � Reduction to Coloring of Overlap Graphs Overlap Graphs N P -complete TW: � C is a special case
Exact Solution Solution Methods Methods Exact � For NS, S: � F IRST F IT and B EST F IT � For the N P -complete versions NC, C, TW: � Graph Coloring (weak formulation) � Minimum Cost Flow with side constraints
Minimum Cost Cost Flow Flow (NC) (NC) Minimum S = ( 3, 5 , 5, 2 , 2, 5 , 5, 4, 2, 2 , 4, 2, 5, 1, 3, 1, ) = 1 P 3 = = 1 P · 1 5 · 1 s = 1 q P 2 = 1 P 4 = 1 forbidden: ( u,v, u,v ) : u 6 = v P 1
Minimum Cost Cost Flow Flow Minimum � This Formulation based on Minimum Cost Flow with side constraints can be applied to NC, C, and TW � These Minimum Cost Flow Problems with side constraints solve the respective versions NC, C, and TW optimally.
Computational Results Results Computational NS NC Network-MIP Color-MIP F IRST F IT F IRST F IT < 1 ms < 1 ms # waggons # trains tracks tracks time [sec] time [sec] tracks 20 10 1 – 5 1 – 5 0,01 0,01 – 0,11 100%: = 100 30 2 – 19 2 – 12 0,01 – 0,02 0,01 – 1,01 50%: = 100%: <+1 300 100 3 – 45 3 – 28 0,13 – 3,05 0,02 – > 2h 50%: <+1 100%: <+4
Computational Results Results Computational S TW C B EST F IT Network-MIP Color-MIP F IRST F IT Network-MIP Color-MIP F IRST F IT < 1 ms < 1 ms < 1 ms # waggons # trains tracks tracks time [sec] time [sec] track tracks time [sec] time [sec] tracks 20 10 7 – 10 1 – 8 0,01 0,01 100%: = 1 – 5 0,01 0,01 100%: = 100 30 25 – 30 2 – 26 0,01 0,01 – 1,09 90%: = 2 – 15 0,01 – 0,04 0,01 – 0,51 90%: = 100%: <+1 100%: <+1 300 100 72 – 100 4 – 74 0,04 - 1,04 0,04 - >2h 50%: = 3 - 35 0,14 - 3,69 0,03 - >2h 50%: <+1 100%: <+3 100%: <+3
Online- -Algorithms Algorithms Online � We say an Online-Algorithm is sensible if it never yields a worst case solution, that is, one with maximal possible gap to optimality � In our case: Optimum: 1 Track, Online-Solution: T Tracks � Strict Online-Interpretation : No information of S in advance � No sensible Online-Algorithms for our problems.
Online- -Algorithms Algorithms Online � Soft Online-Interpretation : Last incoming waggon of a train is signed � F IRST F IT is optimal for online version of NS and B EST F IT for online version of S � No sensible Online-Algorithms for NC,C, and TW
Conclusion & Outlook & Outlook Conclusion � Conclusion: We can solve all our versions with practically relevant input size within a few seconds � Outlook: � Extend problems to more complex ones of our practical project � Open theoretical questions: � Other topologies: queues,… � Bounded case � Multiple sortings
Recommend
More recommend