the crew scheduling problemeaton.math.rpi.edu/faculty/mitchell/courses/matp6620/... ·...

31
The Crew Scheduling Problem John E. Mitchell Department of Mathematical Sciences RPI, Troy, NY 12180 USA April 2019 Mitchell The Crew Scheduling Problem 1 / 21

Upload: others

Post on 06-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

The Crew Scheduling Problem

John E. Mitchell

Department of Mathematical SciencesRPI, Troy, NY 12180 USA

April 2019

Mitchell The Crew Scheduling Problem 1 / 21

Page 2: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

The Set Partitioning Problem

Outline

1 The Set Partitioning Problem

2 Crew scheduling

3 A crew scheduling example

4 Branch-and-price

Mitchell The Crew Scheduling Problem 2 / 21

Page 3: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

The Set Partitioning Problem

The set partitioning problem

We have m objects and we have n subsets Sj ⊆ {1, . . . ,m} of theobjects.

Each subset has a cost cj .

We wish to choose a minimum cost collection of subsets so that eachobject appears in exactly one of the chosen subsets.

We use a binary variable:

xj =

{1 if set Sj is chosen0 otherwise

for j = 1, . . . ,n

Mitchell The Crew Scheduling Problem 3 / 21

Page 4: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

The Set Partitioning Problem

Integer programming formulationWe can formulate this as an integer program:

minx∈Rn∑n

j=1 cjxj

subject to∑

j:i∈Sjxj = 1 for i = 1, . . . ,mx binary

The LP relaxation is:

minx∈Rn∑n

j=1 cjxj

s.t.∑

j:i∈Sjxj = 1 for i = 1, . . . ,mx ≥ 0

Its dual is

maxy∈Rm∑m

i=1 yis.t.

∑i∈Sj

yi ≤ cj for j = 1, . . . ,n

Mitchell The Crew Scheduling Problem 4 / 21

Page 5: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Outline

1 The Set Partitioning Problem

2 Crew scheduling

3 A crew scheduling example

4 Branch-and-price

Mitchell The Crew Scheduling Problem 5 / 21

Page 6: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Crew scheduling

Set partitioning problems often arise as alternative formulations ofother problems.

For example, in the airline industry, it is desired to assign crews toflights.

This could be formulated by using a binary variable to indicate whethera crew is on a particular flight.

Mitchell The Crew Scheduling Problem 6 / 21

Page 7: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Drawbacks

There are some drawbacks to this approach:We need to impose flow conservation constraints for the crews. Itis desirable that they begin and end at their home base, so theycover a cycle. The cost of the crew flying a particular leg doesn’tdepend just on that leg, but rather on the whole cycle: itdetermines their overtime rate, and it imposes limits to ensure thecrew is not fatigued, for example.There is a lot of symmetry. Eg, two crews from the same homebase can be switched between cycles.

Mitchell The Crew Scheduling Problem 7 / 21

Page 8: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Drawbacks

There are some drawbacks to this approach:We need to impose flow conservation constraints for the crews. Itis desirable that they begin and end at their home base, so theycover a cycle. The cost of the crew flying a particular leg doesn’tdepend just on that leg, but rather on the whole cycle: itdetermines their overtime rate, and it imposes limits to ensure thecrew is not fatigued, for example.There is a lot of symmetry. Eg, two crews from the same homebase can be switched between cycles.

Mitchell The Crew Scheduling Problem 7 / 21

Page 9: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation approach

Thus, in practice, the airlines use a crew pairing approach.

They generate lots of cycles (called crew pairings) and see if all theirflights can be partitioned up between these cycles.

This is a set partitioning problem.

Typically, it has far more possible cycles than flights, so n >> m.

Thus, we use a column generation approach, with cycles generateddynamically.

Mitchell The Crew Scheduling Problem 8 / 21

Page 10: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation algorithm to solve LP relaxation ofcrew scheduling

1 Initialize with a collection S of possible crew pairings.2 Solve the primal relaxation of the partitioning problem and its

dual with the current collection of pairings. Obtain solutions x , y .3 Look for more pairings: Search for additional pairings Sj with∑

i∈Sjyi > cj .

4 Terminate: If no violated dual pairing constraints found, STOPwith optimal solution.

5 Loop: Else, add a subset of the violated dual constraints to thedual problem, and add the corresponding columns to the primalproblem. Return to Step 2.

Mitchell The Crew Scheduling Problem 9 / 21

Page 11: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation algorithm to solve LP relaxation ofcrew scheduling

1 Initialize with a collection S of possible crew pairings.2 Solve the primal relaxation of the partitioning problem and its

dual with the current collection of pairings. Obtain solutions x , y .3 Look for more pairings: Search for additional pairings Sj with∑

i∈Sjyi > cj .

4 Terminate: If no violated dual pairing constraints found, STOPwith optimal solution.

5 Loop: Else, add a subset of the violated dual constraints to thedual problem, and add the corresponding columns to the primalproblem. Return to Step 2.

Mitchell The Crew Scheduling Problem 9 / 21

Page 12: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation algorithm to solve LP relaxation ofcrew scheduling

1 Initialize with a collection S of possible crew pairings.2 Solve the primal relaxation of the partitioning problem and its

dual with the current collection of pairings. Obtain solutions x , y .3 Look for more pairings: Search for additional pairings Sj with∑

i∈Sjyi > cj .

4 Terminate: If no violated dual pairing constraints found, STOPwith optimal solution.

5 Loop: Else, add a subset of the violated dual constraints to thedual problem, and add the corresponding columns to the primalproblem. Return to Step 2.

Mitchell The Crew Scheduling Problem 9 / 21

Page 13: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation algorithm to solve LP relaxation ofcrew scheduling

1 Initialize with a collection S of possible crew pairings.2 Solve the primal relaxation of the partitioning problem and its

dual with the current collection of pairings. Obtain solutions x , y .3 Look for more pairings: Search for additional pairings Sj with∑

i∈Sjyi > cj .

4 Terminate: If no violated dual pairing constraints found, STOPwith optimal solution.

5 Loop: Else, add a subset of the violated dual constraints to thedual problem, and add the corresponding columns to the primalproblem. Return to Step 2.

Mitchell The Crew Scheduling Problem 9 / 21

Page 14: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

Column generation algorithm to solve LP relaxation ofcrew scheduling

1 Initialize with a collection S of possible crew pairings.2 Solve the primal relaxation of the partitioning problem and its

dual with the current collection of pairings. Obtain solutions x , y .3 Look for more pairings: Search for additional pairings Sj with∑

i∈Sjyi > cj .

4 Terminate: If no violated dual pairing constraints found, STOPwith optimal solution.

5 Loop: Else, add a subset of the violated dual constraints to thedual problem, and add the corresponding columns to the primalproblem. Return to Step 2.

Mitchell The Crew Scheduling Problem 9 / 21

Page 15: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Crew scheduling

In practice

In practice, the search for pairings takes the majority of the solutiontime.

Once we’ve solved the LP relaxation, we can then try to solve theinteger program, requiring each xi be binary.

We can embed this method to solve the relaxation within abranch-and-bound algorithm.

Mitchell The Crew Scheduling Problem 10 / 21

Page 16: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Outline

1 The Set Partitioning Problem

2 Crew scheduling

3 A crew scheduling example

4 Branch-and-price

Mitchell The Crew Scheduling Problem 11 / 21

Page 17: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

ExampleConsider five cities and ten flights. Assume the timings of the flightscan be adjusted if necessary so that any crew pairing is feasible.

A B

C

D

E

Say we have five initial pairings:1 ABCDEA with cost 452 ADBECA with cost 553 ABEA with cost 244 ADEA with cost 235 BCADB with cost 43.

Mitchell The Crew Scheduling Problem 12 / 21

Page 18: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

ExampleConsider five cities and ten flights. Assume the timings of the flightscan be adjusted if necessary so that any crew pairing is feasible.

A B

C

D

E

Say we have five initial pairings:1 ABCDEA with cost 452 ADBECA with cost 553 ABEA with cost 244 ADEA with cost 235 BCADB with cost 43.

Mitchell The Crew Scheduling Problem 12 / 21

Page 19: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

ExampleConsider five cities and ten flights. Assume the timings of the flightscan be adjusted if necessary so that any crew pairing is feasible.

A B

C

D

E

Say we have five initial pairings:1 ABCDEA with cost 452 ADBECA with cost 553 ABEA with cost 244 ADEA with cost 235 BCADB with cost 43.

Mitchell The Crew Scheduling Problem 12 / 21

Page 20: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

ExampleConsider five cities and ten flights. Assume the timings of the flightscan be adjusted if necessary so that any crew pairing is feasible.

A B

C

D

E

Say we have five initial pairings:1 ABCDEA with cost 452 ADBECA with cost 553 ABEA with cost 244 ADEA with cost 235 BCADB with cost 43.

Mitchell The Crew Scheduling Problem 12 / 21

Page 21: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

ExampleConsider five cities and ten flights. Assume the timings of the flightscan be adjusted if necessary so that any crew pairing is feasible.

A B

C

D

E

Say we have five initial pairings:1 ABCDEA with cost 452 ADBECA with cost 553 ABEA with cost 244 ADEA with cost 235 BCADB with cost 43.

Mitchell The Crew Scheduling Problem 12 / 21

Page 22: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Initial LP relaxation

minx 45x1 +55x2 +24x3 +23x4 +35x5subject to x1 +x3 = 1 AB

x1 +x5 = 1 BCx1 = 1 CDx1 +x4 = 1 DEx1 +x3 +x4 = 1 EA

x2 +x4 +x5 = 1 ADx2 +x5 = 1 DBx2 +x3 = 1 BEx2 = 1 ECx2 +x5 = 1 CA

xj ≥ 0, j = 1, . . . ,5

Mitchell The Crew Scheduling Problem 13 / 21

Page 23: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Dual problem

maxy yAB +yBC +yCD +yDE +yEA +yAD +yDB +yBE +yEC +yCA

subject to yAB +yBC +yCD +yDE +yEA ≤ 45

yAD +yDB +yBE +yEC +yCA ≤ 55

yAB +yEA +yBE ≤ 24

yDE +yEA +yAD ≤ 23

yBC +yAD +yDB +yCA ≤ 35

Mitchell The Crew Scheduling Problem 14 / 21

Page 24: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Optimal solution

The unique feasible (and hence optimal) primal solution isx = (1,1,0,0,0), with value 100.

One optimal dual solution is yAB = 24, yCD = 21, yAD = 23, yDB = 12,yEC = 20, all other ye = 0, also with value 100.

We now check dual feasibility for other pairings.

Say the pairing ECDE has cost 37.

This uses the three edges (E ,C), (C,D), and (D,E). We have

yEC + yCD + yDE = 20 + 21 + 0 = 41 > 37.

Thus, we have a violated dual constraint, which we add to the problem.

Mitchell The Crew Scheduling Problem 15 / 21

Page 25: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Updated dual of LP relaxation

maxy yAB +yBC +yCD +yDE +yEA yAD +yDB +yBE +yEC +yCA

subject to yAB +yBC +yCD +yDE +yEA ≤ 45

yAD +yDB +yBE +yEC +yCA ≤ 55

yAB +yEA +yBE ≤ 24

yDE +yEA +yAD ≤ 23

yBC +yAD +yDB +yCA ≤ 35

yCD +yDE +yEC ≤ 37

Mitchell The Crew Scheduling Problem 16 / 21

Page 26: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Optimal dual solution

One optimal dual solution is yAB = 24, yBC = 21, yEC = 37, yCA = 14,all other ye = 0, with value 96.

Mitchell The Crew Scheduling Problem 17 / 21

Page 27: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

The updated primal problem

minx 45x1 +55x2 +24x3 +23x4 +35x5 +37x6

subject to x1 +x3 = 1 ABx1 +x5 = 1 BCx1 +x6 = 1 CDx1 +x4 +x6 = 1 DEx1 +x3 +x4 = 1 EA

x2 +x4 +x5 = 1 ADx2 +x5 = 1 DBx2 +x3 = 1 BEx2 +x6 = 1 ECx2 +x5 = 1 CA

xj ≥ 0, j = 1, . . . , 5

Mitchell The Crew Scheduling Problem 18 / 21

Page 28: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

A crew scheduling example

Optimal solution

The unique optimal primal solution is x = (0,0,1,0,1,1), with value 96.

For this example, solving the LP relaxation gives a binary solution. Ingeneral, we may need to branch and/or cut.

Mitchell The Crew Scheduling Problem 19 / 21

Page 29: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Branch-and-price

Outline

1 The Set Partitioning Problem

2 Crew scheduling

3 A crew scheduling example

4 Branch-and-price

Mitchell The Crew Scheduling Problem 20 / 21

Page 30: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Branch-and-price

Branch-and-price

Conceptually, we can solve set partitioning problems using thefollowing algorithm:

Solve the problem using branch-and-bound,with the LP relaxations solved using a column generationapproach.

This is known as a branch-and-price algorithm.

If we also use cutting planes, we have a branch-and-price-and-cutalgorithm.

There are various methods for constructing branching rules, which wediscuss in the next handout.

Mitchell The Crew Scheduling Problem 21 / 21

Page 31: The Crew Scheduling Problemeaton.math.rpi.edu/faculty/Mitchell/courses/matp6620/... · 2019-04-19 · Crew scheduling Column generation algorithm to solve LP relaxation of crew scheduling

Branch-and-price

Branch-and-price

Conceptually, we can solve set partitioning problems using thefollowing algorithm:

Solve the problem using branch-and-bound,with the LP relaxations solved using a column generationapproach.

This is known as a branch-and-price algorithm.

If we also use cutting planes, we have a branch-and-price-and-cutalgorithm.

There are various methods for constructing branching rules, which wediscuss in the next handout.

Mitchell The Crew Scheduling Problem 21 / 21