Integer programming for locating ambulances
Laura Albert McLay
The Industrial & Systems Engineering Department
University of Wisconsin-Madison
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
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)
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
Top Related