Scheduling and Timetabling, Lecture 3 Han Hoogeveen, Utrecht - - PowerPoint PPT Presentation

scheduling and timetabling lecture 3 han hoogeveen
SMART_READER_LITE
LIVE PREVIEW

Scheduling and Timetabling, Lecture 3 Han Hoogeveen, Utrecht - - PowerPoint PPT Presentation

Scheduling and Timetabling, Lecture 3 Han Hoogeveen, Utrecht University 1 Lecture today Finding a timetable for the trains Routing trains through stations Dividing additional driving time Branch-and-bound (brush up) Is the first assignment


slide-1
SLIDE 1

Scheduling and Timetabling, Lecture 3 Han Hoogeveen, Utrecht University

1

slide-2
SLIDE 2

Lecture today

Finding a timetable for the trains Routing trains through stations Dividing additional driving time Branch-and-bound (brush up) Is the first assignment clear?

2

slide-3
SLIDE 3

Finding a good train schedule

See the paper ‘A cycle based optimization model for the cyclic railway timetabling problem’ by Leon Peeters and Leo Kroon (on the website). This approach is used by the Dutch Railways. They won the Edelman award for it (which is considered ‘the price’ for Operations Research).

3

slide-4
SLIDE 4

Problem description

We are given:

Data concerning the infrastructure How the trains should run (the trips from where to where) The frequency of each trip per hour

We are asked to find a periodic schedule (period 60 minutes) for the trains; you must specify for each stop in each trip when the train will arrive and when it will depart. First: how to model this problem (assumptions, constraints,

  • bjective)?

4

slide-5
SLIDE 5

Model of the NS-problem

Assumptions:

all resources are at the right place at the desired time no disturbances routing the trains through the station is always possible

Constraints

Safety constraints: at least three minutes difference between trains Driving times ‘Marketing constraints’ like:

smooth connections; if frequency ≥ 2, then evenly spread in time.

Objectives:

Penalties for deviations from optimal time-length connection Use of material needed for driving the time table

5

slide-6
SLIDE 6

Solution approach: ILP

Define an event for each arrival/departure; we must decide on the time at which each event takes place measured in minutes. We want a cyclic solution with cycle duration T (60 minutes here): all events must take place at the same time each hour. Formulate the problem using Integer Linear Programming: Variables: Introduce a variable vi for each event i vi will specify the time at which event i takes place vi ∈ {0, 1, 2, . . . , 59}

6

slide-7
SLIDE 7

ILP: Constraints

Constraints are introduced to express the relation between two events in time (we only need constraints between two events) General form of a constraint of i on j: vj − vi ∈ [lij, uij]T This constraint indicates that the difference between the two events should be in between lij and uij minutes, taking the desired duration of T into account. For example: the difference between departure from A and arrival at B is 19 or 20 minutes. Then lij = 19 and uij = 20. Using T = 60 implies that vi = 55 and vj = 15 satisfy the constraint. The constraint is not linear; how to make it linear?

7

slide-8
SLIDE 8

Formulating it as an ILP

Introduce a new variable: pij. pij indicates the difference in cycle events i and j vj − vi ∈ [lij, uij]T ⇐ ⇒ lij ≤ vj − vi + Tpij ≤ uij Example: 19 ≤ vj − vi + Tpij ≤ 20 vi = 15 and vj = 35 satisfies the constraint with pij = 0; vi = 55 and vj = 15 satisfies the constraint with pij = 1. pij must be integral; negative values are possible.

8

slide-9
SLIDE 9

Reversing the constraint

You sometimes do not know whether vi will take place after vj

  • r the other way around.

Suppose you formulate the constraint in terms of vj − vi: lij ≤ vj − vi + Tpij ≤ uij You can reverse it to get vi − vj as follows: lij ≤ vj − vi + Tpij ≤ uij −lij ≥ −vj + vi − Tpij ≥ −uij −uij ≤ vi − vj − Tpij ≤ −lij T − uij ≤ vi − vj − Tpij + T ≤ T − lij lji ≤ vi − vj + Tpji ≤ uji Hence, we must have that lji = T − uij; uji = T − lij; pji = 1 − pij.

9

slide-10
SLIDE 10

Feasible region

The feasible region is described as the set X with X =

  • vj ∈ R

pij ∈ Z

  • lij ≤ vj − vi + Tpij ≤ uij

0 ≤ vi ≤ 59

  • Because of Total UniModularity (TUM) of the constraint matrix,

an optimal solution will have integral vi values.

10

slide-11
SLIDE 11

Cycle representation (1)

Define graph G = (V , A) with V is set of events (i, j) ∈ A if and only if there is a constraint of i on j of the form lij ≤ vj − vi + Tpij ≤ uij Substitute xij = (vj − vi) for each arc (i, j) ∈ A. For any cycle (i, j)(j, k)(k, i) ∈ A we have that xij + xjk + xki = (vj − vi) + (vk − vj) + (vi − vk) = 0 Observation: this holds for each cycle in G = (V , A); call this the cycle-constraint.

11

slide-12
SLIDE 12

Cycle representation (2)

Another observation: xij = −xji. Use this to derive more general cycle constraints. Ignore (only now) the orientation of A (so E = A). Suppose c is a cycle in the resulting graph. Fix an orientation for c. For any arc (i, j) ∈ A define γc

ij =

    

if {i, j} / ∈ c 1 if (i, j) ∈ c −1 if (j, i) ∈ c The feasible region is empty, unless

  • (i,j)∈A

γc

ijxij = 0

∀cycles c It is sufficient to consider the cycles in the cyclebase C.

12

slide-13
SLIDE 13

Example (1)

❅ ❅ ❅ ❅ ■ ✲ ✲ ✻ ✻

❅ ❅ ❅

1 2 3 4 5 1 2 3 4 5 Three cycles in the undirected graph: (1, 2, 3, 4), (4, 3, 5) and (1, 2, 3, 5, 4). The first one yields the constraint x12 + x23 + x34 + x41 = 0

13

slide-14
SLIDE 14

Example (2)

❅ ❅ ❅ ■ ✲ ✲ ✻ ✻

❅ ❅

1 2 3 4 5 1 2 3 4 5 Since the arcs (3, 4) and (4, 1) do not exist, we use x34 = −x43 and x41 = −x14. The constraint becomes x12 + x23 − x43 − x14 = 0 Similarly, x43 + x35 − x45 = 0 Adding up the two constraints yields x12 + x23 + x35 − x45 − x14 = 0 This is the constraint for cycle (1, 2, 3, 5, 4).

14

slide-15
SLIDE 15

Rewriting feasible region (1)

X =

  • xij ∈ R

pij ∈ Z

  • (i,j)∈A γc

ijxij = 0

∀c ∈ C lij ≤ xij + Tpij ≤ uij

  • Define yij = xij + Tpij and substitute (xij = yij − Tpij):

X =

  • yij ∈ R

pij ∈ Z

  • (i,j)∈A γc

ijyij = T (i,j)∈A γc ijpij

∀c ∈ C lij ≤ yij ≤ uij

  • 15
slide-16
SLIDE 16

Rewriting feasible region (2)

X =

  • yij ∈ R

pij ∈ Z

  • (i,j)∈A γc

ijyij = T (i,j)∈A γc ijpij

∀c ∈ C lij ≤ yij ≤ uij

  • Define qc =

(i,j)∈A γc ijpij:

X =

  • xij ∈ R

qc ∈ Z

  • (i,j)∈A γc

ijyij = Tqc

∀c ∈ C lij ≤ yij ≤ uij

  • Tqc is equal to the time it takes to move along cycle c!

16

slide-17
SLIDE 17

Rewriting feasible region (3)

Since qc is integral, you can derive an lower and upper bound for each qc using the constraints lij ≤ xij + Tpij ≤ uij ⌈

  

  • (i,j):γc

ij=1

lij −

  • (i,j):γc

ij=−1

uij

   /T⌉ ≤ qc ≤

  

  • (i,j):γc

ij=1

uij −

  • (i,j):γc

ij=−1

lij

   /T⌋

Add these bounds to the ILP and solve it. Given a value for the qc variables, you can determine a feasible solution for the xij variables.

17

slide-18
SLIDE 18

Derivation of bound on qc (1)

Consider cycle c = (1, 2, 3); assume this yields the constraint x12 + x23 − x13 = 0 (γc

12 = 1, γc 23 = 1, γc 13 = −1).

We have that qc = p12 + p23 − p13 The constraints are l12 ≤ x12 + Tp12 ≤ u12, etc. Since we have −x13, we have to reverse the constraint l13 ≤ x13 + Tp13 ≤ u13. Multiplying it by −1 and rewriting gives −u13 ≤ −x13 − Tp13 ≤ −l13. Now we have the following three constraints: l12 ≤ x12 + Tp12 ≤ u12 l23 ≤ x23 + Tp23 ≤ u23 −u13 ≤ −x13 − Tp13 ≤ −l13

18

slide-19
SLIDE 19

Derivation of bound on qc (2)

Add up all three constraints; this yields l12+l23−u13 ≤ x12+x23−x13+T(p12+p23−p13) ≤ u12+u23−l13 Remark that x12 + x23 − x13 = 0; divide by T: l12 + l23 − u13 T ≤ (p12 + p23 − p13) ≤ u12 + u23 − l13 T Since qc = p12 + p23 − p13 is integral, we can round up the lower bound and round down the upper bound; this gives the bound of the previous page.

19

slide-20
SLIDE 20

Constructing a cyle base

Goal: construct a cycle base for the undirected graph G = (V , E) Start with any spanning tree T of E. Renumber the remaining edges as e1, e2, . . . , ek, with k = |E| − (|V | − 1). Construct cycle j (j = 1, . . . , k) of the cycle base as follows:

Add ej to T; this yields a cycle. Cycle j contains the edges that the cycle in T ∪ {ej} consists

  • f.

Remove ej from T.

Observation: ej occurs only in cycle j; edges in T can show up in several cycles. We can use this observation to find a ‘good’ cycle base. What would we like to have in a cycle base, and how can we try to achieve this?

20

slide-21
SLIDE 21

Constructing a ‘good’ cyle base (1)

Important for a cycle base is the remark: ‘Given a value for the qc variables, you can determine a feasible solution for the xij variables.’ To find a value for the qc you must solve an ILP; this can be difficult. Use here the bounds on qc: ⌈

  

  • (i,j):γc

ij=1

lij −

  • (i,j):γc

ij=−1

uij

   /T⌉ ≤ qc ≤

  

  • (i,j):γc

ij=1

uij −

  • (i,j):γc

ij=−1

lij

   /T⌋

21

slide-22
SLIDE 22

Constructing a ‘good’ cyle base (2)

Strong bounds on qc reduce the search space, especially when the upper and lower bound are equal. The difference between the lower bound and upper bound before rounding is equal to uij − lij for each arc (i, j) ∈ c. The cycle base is fixed once the spanning tree has been fixed. Only arcs in the tree can show up in more than one cycle. Strategy: try to include as many edges with small difference uij − lij in the tree. Especially, try to avoid edges corresponding to safety constraints, since these have uij − lij = 54. Cycle constraints and cycle bases also are very important in planning electricity networks. How can you write a given cycle in terms of cycles in the cycle base?

22

slide-23
SLIDE 23

Objective function

Two components in the objective: Amount of rolling stock needed Penalties for violating soft constraints (bad connections for example) Objective 1: minimize necessary amount of rolling stock The amount of material is estimated on basis of the length of some big cycles. Let c be such a cycle; we are interested in finding qc. If c is not in the cycle base, then c can be constructed by adding and removing cycles that are in the cycle base; for example, c = c1 ∪ c2 \ c3. We can compute qc then by adding up/subtracting several values qc′; in the example, we find qc = qc1 + qc2 − qc3.

23

slide-24
SLIDE 24

Quality of connections, etc.

A connection depends on the timing of two events vi and vj Introduce the constraint in the model; the corresponding xij

  • ccurs as a variable

Include a penalty function based on xij in the objective Example: preferred time between arrival and departure time at a station (stopover) is 3 minutes; vi is arrival time and vj is departure time. Add constraint 2 ≤ vj − vi + Tpij ≤ 6 or 2 ≤ xij + Tpij ≤ 6. Define f (xij) as the penalty cost; we want that f (xij) is something like a parabolic function with a minimum at xij = 3. We must approximate the parabolic function using linear functions. How to model the constraint that two trains should be at the same station at the same time (corresponding to −2 ≤ vj − vi ≤ 2)?

24

slide-25
SLIDE 25

Engineering

The ILP model is rather big and hard to solve. Apply preprocessing, like

Remove redundant constraints; for example safety constraints that are enforced by the frequency constraints Merge constraints corresponding to subsequent stops. For example, if you want to plan the line from A to B, is it necessary to plan the times at stopovers in between A and B? Be careful with fast and slow trains.

Decomposition: remove isolated lines from the main problem and plan these later given the solution to the main problem. How to define which connections to guarantee in case of frequent trains?

25

slide-26
SLIDE 26

Routing trains through the station

Initial assumption: It is always possible to route the trains through the station Check this: formulate an algorithm to find such a routing. Based on the paper ‘Routing trains through a railway station based on a node packingmodel’ (available on the website)

26

slide-27
SLIDE 27

Sketch of the situation

27

slide-28
SLIDE 28

Problem description

Input:

The layout of the station (track sections and platform tracks) The trains:

Arrival and departure time (at the platform) Direction of travel = ⇒ Entering point and leaving point

Desired output for each train

an inbound route a platform track (even if you don’t want to stop at this station) an outbound route

Constraints

no routing conflicts (hard) customer desires (almost hard)

28

slide-29
SLIDE 29

Solution approach

For each train t enumerate all relevant routes; denote this set by Rt. Also include routes that deviate a little from the desired arrival/departure time. For each route you can define a weight (preference for this route). For each pair of dependent trains t and t′ determine Ft,t′; Ft,t′ contains the pairs of routes that are compatible. Through these sets Ft,t′ you can enforce that trains to A always leave from the same platform (and that trains from A always arrive at the same platform). Similarly, you can enforce that connecting trains stop at the

  • pposite sites of a platform.

29

slide-30
SLIDE 30

ILP approach based on node-packing

Variables: define for each train t and each possible route r the binary variable xtr that gets value 1 if train t follows this route. Constraints: If (t, r) and (t′, r ′) are not compatible, then choose at most one of these. Similarly, at most one route per train. Objective: Find a feasible selection of routes with maximum total weight. Preprocessing: remove all dominated (t, r); this reduces the number of variables by 90% (see paper).

30

slide-31
SLIDE 31

ILP approach based on node-packing

Construct a graph with

a node for each (t, r) an edge between (t, r) and (t′, r ′) if these are not compatible

Constraints: if two nodes (t, r) and (t′, r ′) are connected, then you can choose at most one of these. This can be enforced by adding the constraint xt,r + xt′,r′ ≤ 1

31

slide-32
SLIDE 32

Branch-and-bound to solve the ILP

Solve the ILP using branch-and-bound, where the bound is

  • btained by solving the LP-relaxation

The LP-relaxation is obtained by replacing the constraint xtr ∈ {0, 1} with 0 ≤ xtr ≤ 1. The upper bound xtr ≤ 1 can be removed here. Solution procedure: For a given node in the branch-and-bound tree: solve the LP-relaxation Decrease the upper bound using valid inequalities (only if success may be possible) If the node cannot be discarded, then branch.

32

slide-33
SLIDE 33

Valid inequalities

Situation: you must solve some ILP (with integrality constraints) Consider the LP-relaxation (ignore the integrality constraints) and solve it. A valid inequality for an LP is a constraint that is valid for all integral solutions but that is violated by the current optimum

  • f the LP.

33

slide-34
SLIDE 34

Example of a valid inequality

Maximum cardinality matching in an arbitrary graph Given any graph G = (V , E) you must select a subset M of E with maximum cardinality such that no two edges in M have a vertex in common. ILP formulation: number the edges 1, . . . , m. Use binary variables xj that indicate whether edge j has been selected. Constraints: if xi and xj have a vertex in common, then add the constraint xi + xj ≤ 1. Typical example: G corresponds to a triangle. Solution of the LP-relaxation? Valid inequalities?

34

slide-35
SLIDE 35

Robustness (1)

Small delays may occur It would be nice if you can still use the same route (no replanning required). How can you find a solution that is as robust if possible (in which you still route all trains)?

35

slide-36
SLIDE 36

Robustness (2)

The idea is that you penalize non-robust combinations: they can be chosen, but are not preferred. For each pair of compatible routes (t, r) and (t′, r ′) check if this combination is ‘robust enough’. If not robust enough, then introduce the non-negative variable y(t,r)(t′,r′) Add the constraint xt,r + xt′,r′ ≤ 1 + y(t,r)(t′,r′) Include y(t,r)(t′,r′) in the objective value with a weight that depends on how happy you are with this combination.

36