Integer programming for locating ambulances

29
Integer programming for locating ambulances Laura Albert McLay The Industrial & Systems Engineering Department University of Wisconsin-Madison [email protected] punkrockOR.wordpress.com @lauramclay 1 This work was in part supported by the U.S. Department of the Army under Grant Award Number W911NF-10-1-0176 and by the National Science Foundation under Award No. CMMI -1054148, 1444219.

Transcript of Integer programming for locating ambulances

Integer programming for locating ambulances

Laura Albert McLay

The Industrial & Systems Engineering Department

University of Wisconsin-Madison

[email protected]

punkrockOR.wordpress.com

@lauramclay

1This work was in part supported by the U.S. Department of the Army under Grant Award Number W911NF-10-1-0176 and

by the National Science Foundation under Award No. CMMI -1054148, 1444219.

The problem

β€’ We want to locate 𝑠 ambulances at stations in a geographic region to β€œcover” the most calls in 9 minutes

β€’ What we need to include:1. Different call volumes at different locations

2. Non-deterministic travel times

3. Each ambulance responds to roughly the same number of calls

4. Ambulances that are not always available (backup coverage is important)

2

The solution:

3

Anatomy of a 911 call

Response time

Service provider:

Emergency 911 callUnit

dispatchedUnit is en

routeUnit arrives

at sceneService/care

provided

Unit leaves scene

Unit arrives at hospital

Patient transferred

Unit returns to service

4

Objective functions

β€’ NFPA standard yields a coverage objective function for response time threshold (RTT)β€’ Most common RTT: nine minutes for 80% of calls

β€’ A call with response time of 8:59 is covered

β€’ A call with response time of 9:00 is not covered

Why RTTs?

β€’ Easy to measure

β€’ Intuitive

β€’ Unambiguous

5

Coverage models for EMS

β€’ Expected coverage objectiveβ€’ Maximize expected number of calls covered by a 9

minute response time interval

β€’ Coverage issues:β€’ Ambulance unavailability: Ambulances not available

when servicing a patient (spatial queuing)

β€’ Fractional coverage: coverage is not binary due to uncertain travel times

β€’ Other issues:β€’ Which ambulance to send? As backup?

β€’ Side constraints:β€’ Balanced workload

6

Ambulance unavailability /fractional coverage

7

Fractional coverage /

Facility unavailability

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Perfect coverage /

Availability

Why use optimization models?

Because it helps you identify solutions that are not intuitive. This adds value!

8

MODEL

Model 1: covering location modelsAdjusts for different call volumes at different locations (#1), but does not include our other needs

9

Model 1 formulation

Parametersβ€’ 𝑁 = set of demand locations

β€’ 𝑆 = set of stations

β€’ 𝑑𝑖 = demand at 𝑖 ∈ 𝑁

β€’ π‘Ÿπ‘–π‘—= fraction of calls at location 𝑖 βˆˆπ‘ that can be reached by 9 minutes from an ambulance from station 𝑗 ∈ 𝑆.

β€’ When travel times are deterministic, then π‘Ÿπ‘–π‘— ∈ {0, 1}

β€’ 𝐽𝑖 βŠ‚ 𝑆 = subset of stations that can respond to calls at 𝑖 within 9 minutes, 𝑖 ∈ 𝑁:

β€’ 𝐽𝑖 = 𝑗: π‘Ÿπ‘–π‘— = 1

β€’ 𝐽𝑖 = all stations that encircle 𝑖

Decision variables

β€’ 𝑦𝑗 = 1 if we locate an ambulance at station 𝑗 ∈ 𝑆 (and 0 otherwise)

β€’ π‘₯𝑖 = 1 if calls at 𝑖 ∈ 𝑁 are covered (and 0 otherwise)

β€’ We must locate all 𝑆 ambulances at stations

β€’ Linking constraint: a location 𝑖 βˆˆπ‘ is covered only if one of the stations in 𝐽𝑖 has an ambulance

β€’ Integrality constraints on the variables

10

Constraints (in words)

Maximal Covering Location Problem #1

max

π‘–βˆˆπ‘

𝑑𝑖π‘₯𝑖

Subject to:

π‘₯𝑖 ≀

π‘—βˆˆπ½π‘–

𝑦𝑗

π‘—βˆˆπ‘†

𝑦𝑗 = 𝑠

π‘₯𝑖 ∈ 0, 1 , 𝑖 ∈ 𝑁𝑦𝑖 ∈ 0, 1 , 𝑗 ∈ 𝑆

11

Church, Richard, and Charles R. Velle. "The maximal covering location problem." Papers in

regional science 32, no. 1 (1974): 101-118.

Example inputsInput parameters Coverage

12

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Covering all locations is impossible!

Example solutionModel 1 solutions

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Limitations

13

β€’ Does not look at backup coverage

β€’ Assumes all calls in circles are 100% β€œcovered”

β€’ Does not assign calls to stations

β€’ Each ambulance does not respond to same number of calls

Model 2: p-median models to maximize expected coverageAddresses:

1. Different call volumes at different locations

2. Non-deterministic travel times

3. Each ambulance responds to roughly the same number of calls

Does not address #4: backup coverage14

Non-deterministic travel times

15

0

0.2

0.4

0.6

0.8

1

1.2

0 1 2 3 4 5 6 7 8 9 10

Co

vera

ge

Distance (miles)

Partial coverage from data 0-1 coverage

Expon. (Partial coverage from data)

Let’s extend our formulation

16

Model formulation

Parameters

β€’ 𝑁 = set of demand locations

β€’ 𝑆 = set of stations

β€’ 𝑑𝑖 = demand at 𝑖 ∈ 𝑁

β€’ π‘Ÿπ‘–π‘—= fraction of calls at location 𝑖 ∈ 𝑁 that can be reached by 9 minutes from an ambulance from station 𝑗 ∈ 𝑆.

β€’ π’“π’Šπ’‹ ∈ 𝟎, 𝟏 (fractional!)

β€’ 𝒍 = lower bound on number of calls assigned to each open station

β€’ 𝑐 = capacity of each station (max number of ambulances, 𝑐 = 1)

Decision variablesβ€’ 𝑦𝑗 = 1 if we locate an ambulance at

station 𝑗 ∈ 𝑆 (and 0 otherwise)

β€’ π’™π’Šπ’‹ = 1 if calls at π’Š ∈ 𝑡 are assigned to station 𝒋 (and 0 otherwise)

β€’ We must locate all 𝑠 ambulances at stations

β€’ Each open station must have at least 𝒍 calls assigned to it

β€’ Linking constraint: a location π’Š ∈ 𝑡can be assigned to station 𝒋 only if 𝒋has an ambulance

β€’ Each location must be assigned to at most one (open) station

β€’ Integrality constraints on the variables

17

Constraints (in words)

Integer programming bag of tricks

β€’ 𝛿 = 1 β†’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 ≀ 𝑏

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 +𝑀 𝛿 ≀ 𝑀 + 𝑏

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 ≀ 𝑏 β†’ 𝛿 = 1β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 βˆ’ π‘š βˆ’ πœ– 𝛿 ≀ 𝑏 + πœ–

β€’ 𝛿 = 1 β†’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 β‰₯ 𝑏

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 +π‘š 𝛿 β‰₯ π‘š + 𝑏

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 β‰₯ 𝑏 β†’ 𝛿 = 1β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 βˆ’ 𝑀 + πœ– 𝛿 ≀ 𝑏 βˆ’ πœ–

β€’ 𝛿 is a binary variable

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 constraint LHS

β€’ 𝑏: constraint RHS

β€’ 𝑀: upper bound on π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 βˆ’ 𝑏

β€’ π‘š: lower bound on π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 βˆ’ 𝑏

β€’ πœ–: constraint violation amount (0.01 or 1)

18

Each open station must have at least 𝒍 calls assigned to it

Maximal Covering Location Problem #2

max

π‘–βˆˆπ‘

π‘—βˆˆπ‘†

π‘‘π‘–π‘Ÿπ‘–π‘—π‘₯𝑖𝑗

Subject to:π‘₯𝑖𝑗 ≀ 𝑦𝑗 , 𝑖 ∈ 𝑁, 𝑗 ∈ 𝑆

π‘—βˆˆπ‘†

π‘₯𝑖𝑗 = 1, 𝑖 ∈ 𝑁

π‘—βˆˆπ‘†

𝑦𝑗 = 𝑠

π‘–βˆˆπ‘

𝑑𝑖π‘₯𝑖𝑗 β‰₯ 𝑙 𝑦𝑗 , 𝑗 ∈ 𝑆

π‘₯𝑖𝑗 ∈ 0, 1 , 𝑖 ∈ 𝑁, 𝑗 ∈ 𝑆𝑦𝑖 ∈ 0, 1,… , 𝑐 , 𝑗 ∈ 𝑆

19

Bag of tricks

β€’ We want to use this one:β€’ 𝛿 = 1 β†’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 β‰₯ 𝑏

β€’ π‘—βˆˆπ‘ π‘Žπ‘—π‘₯𝑗 +π‘š 𝛿 β‰₯ π‘š + 𝑏

For this:

β€’ 𝑦𝑗 = 1 β†’ π‘–βˆˆπ‘ 𝑑𝑖π‘₯𝑖𝑗 β‰₯ 𝑙

β€’ Step 1:β€’ Find π‘š: lower bound on π‘–βˆˆπ‘ 𝑑𝑖π‘₯𝑖𝑗 βˆ’ 𝑙‒ This is βˆ’π‘™ since we could assign no calls to 𝑗

β€’ Step 2: Put it together and simplifyβ€’ π‘–βˆˆπ‘ 𝑑𝑖π‘₯𝑖𝑗 βˆ’ 𝑙 𝑦𝑗 β‰₯ βˆ’π‘™ + 𝑙 simplifies to

β€’ π‘–βˆˆπ‘ 𝑑𝑖π‘₯𝑖𝑗 β‰₯ 𝑙 𝑦𝑗

β€’ Note: this will also work when we let up to 𝑐ambulances located at a stationβ€’ 𝑦𝑖 ∈ 0, 1, … , 𝑐

20

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Example solution

No minimum per stationobj = 194.6

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Minimum of 60 per stationobj = 191.4

21

101

49

27

90

60

84

60

63

Example solution

Model 1

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

Model2

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

22

Model 3: p-median models to maximize expected (backup) coverageAddresses:

1. Different call volumes at different locations

2. Non-deterministic travel times

3. Each ambulance responds to roughly the same number of calls

4. Ambulances that are not always available (backup coverage is important)

23

Ambulances that are not always available

Let’s model this as follows:

β€’ Let’s pick the top 3 ambulances that should respond to each call

β€’ Ambulance 1, 2, 3 responds to a call with probability πœ‹1, πœ‹2, πœ‹3with πœ‹1 + πœ‹2 + πœ‹3 < 1.

Ambulances are busy with probability 𝜌

1. First choice ambulance response with probability Ο€1 β‰ˆ 1 βˆ’ 𝜌

2. Second choice ambulance response with probability Ο€2 β‰ˆπœŒ(1 βˆ’ 𝜌)

3. Third choice ambulance response with probability Ο€3 β‰ˆπœŒ2 1 βˆ’ 𝜌

β€’ If 𝜌 = 0.3 then πœ‹1 = 0.7, πœ‹2 = 0.21, πœ‹3 = 0.063 (sum to 0.973)

β€’ If 𝜌 = 0.5 then πœ‹1 = 0.5, πœ‹2 = 0.25, πœ‹3 = 0.125 (sum to 0.875)

24

New variables

We need to change this variable:

β€’ π‘₯𝑖𝑗 = 1 if calls at 𝑖 ∈ 𝑁 are assigned to station 𝑗 (and 0 otherwise)

to this:

β€’ π‘₯π‘–π‘—π‘˜ = 1 if calls at 𝑖 ∈ 𝑁 are assigned to station 𝑗 at the π‘˜π‘‘β„Ž priority, π‘˜ = 1, 2, 3.

Note: this is cool!

This tells us which ambulance to send, not just where to locate the ambulances.

25

Model formulation

Parametersβ€’ 𝑁 = set of demand locations

β€’ 𝑆 = set of stations

β€’ 𝑑𝑖 = demand at 𝑖 ∈ 𝑁

β€’ π‘Ÿπ‘–π‘—= fraction of calls at location 𝑖 ∈ 𝑁 that can be reached by 9 minutes from an ambulance from station 𝑗 ∈ 𝑆.

β€’ π‘Ÿπ‘–π‘— ∈ 0,1

β€’ 𝑙 = lower bound on number of calls assigned to each open station

β€’ π…πŸ,π…πŸ, π…πŸ‘ = proportion of calls when the 1st, 2nd, and 3rd

preferred ambulance responds

Decision variablesβ€’ 𝑦𝑗 = 1 if we locate an ambulance at

station 𝑗 ∈ 𝑆 (and 0 otherwise)

β€’ π’™π’Šπ’‹π’Œ = 1 if station 𝒋 is the π’Œth preferred ambulance for calls at π’Š ∈ 𝑡, π’Œ = 𝟏, 𝟐, πŸ‘.

β€’ We must locate all 𝑆 ambulances at stations (at most one per station)

β€’ Each open station must have at least 𝑙 calls assigned to it

β€’ Linking constraint: a location 𝑖 ∈ 𝑁 can be assigned to station 𝑗 only if 𝑗 has an ambulance

β€’ Each location must be assigned to 3 (open) stations

β€’ 3 different stationsβ€’ Stations must be assigned in a specified

order

β€’ Integrality constraints on the variables26

Constraints (in words)

Maximal Covering Location Problem #3

max

π‘–βˆˆπ‘

π‘—βˆˆπ‘†

π‘˜=1

3

π‘‘π‘–πœ‹π‘˜π‘Ÿπ‘–π‘—π‘₯π‘–π‘—π‘˜

Subject to:

π‘₯π‘–π‘—π‘˜ ≀ 𝑦𝑗 , 𝑖 ∈ 𝑁, 𝑗 ∈ 𝑆, π‘˜ = 1,2,3 [no longer needed]

π‘—βˆˆπ‘†

π‘₯π‘–π‘—π‘˜ = 1, 𝑖 ∈ 𝑁, π‘˜ = 1,2,3

π‘₯𝑖𝑗1 + π‘₯𝑖𝑗2 + π‘₯𝑖𝑗3 ≀ 𝑦𝑗 , 𝑖 ∈ 𝑁 , 𝑗 ∈ 𝑆

π‘—βˆˆπ‘†

𝑦𝑗 = 𝑠

π‘–βˆˆπ‘

π‘˜=1

3

π‘‘π‘–πœ‹π‘˜π‘₯π‘–π‘—π‘˜ β‰₯ 𝑙 𝑦𝑗 , 𝑗 ∈ 𝑆

π‘₯π‘–π‘—π‘˜ ∈ 0, 1 , 𝑖 ∈ 𝑁, 𝑗 ∈ 𝑆, π‘˜ = 1,2,3𝑦𝑖 ∈ 0, 1 , 𝑗 ∈ 𝑆

27

Example solution

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

28

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

First priority assignments Second priority assignments Third priority assignments

πœ‹1 = 0.65πœ‹2 = 0.23πœ‹3 = 0.08

Related blog posts

β€’ A YouTube video about my research

β€’ In defense of model simplicity

β€’ Operations research, disasters, and science communication

β€’ Domino optimization art

29