The Power of Two Choices on Graphs: the Pair

The Power of Two Choices on Graphs: the
Pair-Approximation is Accurate
Nicolas Gast
Inria
ACM MAMA Workshop, June 15, 2015, Portland, Oregon
Nicolas Gast – 1 / 25
Motivating scenario is to study incentives in bike-sharing
systems
1200 stations
20k bikes
Map of Velib’ stations (Paris)
Nicolas Gast – 2 / 25
These system can be viewed as closed queuing-networks
λ
take an object
Use it for
a while
if station full
Expo(1/µ)
return it
Uniform routing
N stations, capacity C bikes per station.
Nicolas Gast – 3 / 25
When the number of stations N → ∞, we can show that
the model boils down to a single (open) queue.
Moving bikes
arrival of bikes
departure of bikes
Nicolas Gast – 4 / 25
When the number of stations N → ∞, we can show that
the model boils down to a single (open) queue.
Moving bikes
µZ
NZ
λ
i 7→ i + 1 at rate µZ
i 7→ i − 1 at rate λ
(i < K )
(i > 0)
Nicolas Gast – 4 / 25
Can we improve performance?
Even in a uniform scenario, the proportion of problematic stations
(i.e. empty or full) is at least 1/(C + 1).
What if a user chooses to go to a less crowded station?
Nicolas Gast – 5 / 25
In this talk, I study a generalization of the two-choice
models
N identical servers
Exponential service time
1
Arrival Nλ
Pick two
at random
1
What happens when we restrict the choice to two neighbors?
Nicolas Gast – 6 / 25
Outline
1
The classical two-choice model
2
Construction of the pair approximation equations
3
Numerical validation: the pair approximation is accurate!
4
Remarks and open questions
Nicolas Gast – 7 / 25
Outline
1
The classical two-choice model
2
Construction of the pair approximation equations
3
Numerical validation: the pair approximation is accurate!
4
Remarks and open questions
Nicolas Gast – 8 / 25
Two-choice rule: each incoming job/bike is routed to the
least loaded of two servers picked at random.
?
Nicolas Gast – 9 / 25
Two-choice rule: each incoming job/bike is routed to the
least loaded of two servers picked at random.
?
Paradigm known as “the power of two choices”:
Comes from balls and bills [Azar et al. 94]:
I
Throw n balls into n bins: what is the maximal number of balls in a
bin?
F
F
log(n) if no choice
log(log(n)) is two choices.
Drastic improvement of service time in server farm [Vvedenskaya 96,
Mitzenmacher 96]
I
I
P(#jobs ≥ i)ρi (no choice)
i+1
P(#jobs ≥ i) = 2λ −1 (two choices)
Interesting advances for non-exponential service times (Bramson
2000, Ramanan 2014)
Nicolas Gast – 9 / 25
We use mean-field to solve the two-choice equations
1
Arrival Nλ
Pick two
at random
1
Nicolas Gast – 10 / 25
We use mean-field to solve the two-choice equations
1
Arrival Nλ
Pick two
at random
1
Let xj be the proportion of stations with j bikes.
(i 7→ i − 1) at rate 1
(i 7→ i + 1) at rate λ(xi + 2
∞
X
xj )
j=i+1
Note: the rate of change of xi has to be multiplied by xi .
Nicolas Gast – 10 / 25
With no geometry, we can solve the equation in close-form
i
i+1
xi = λ2 − λ2
0.30
no choice
two-choice (no space)
0.25
0.20
0.15
0.10
0.05
0.00
0
5
10
15
20
For bike-sharing, choosing two stations
random, decreases the number
√ at −C
of problematic stations from 1/C to C 2 /2
Nicolas Gast – 11 / 25
With no geometry, we can solve the equation in close-form
i
i+1
xi = λ2 − λ2
100
no choice
two-choice (no space)
10-1
10-2
10-3
10-4
10-5
10-6
0
5
10
15
20
For bike-sharing, choosing two stations
√ at random, decreases the number
of problematic stations from 1/C to C 2−C /2
Nicolas Gast – 11 / 25
What if we add geometry?
Arrival Nλ
1
Pick two
neighbors
at random
1
Mean field do not apply (geometry) :(.
For balls and bins, the power of two-choice does not work (see
[Kenthapadi et al. 06])
Only numerical results?
Nicolas Gast – 12 / 25
Outline
1
The classical two-choice model
2
Construction of the pair approximation equations
3
Numerical validation: the pair approximation is accurate!
4
Remarks and open questions
Nicolas Gast – 13 / 25
I consider that stations are placed on a ring
Arrival Nλ
Pick two
neighbors
at random
1
1
Let yij be the proportion of (ordered) pairs having (i, j) jobs.
Nicolas Gast – 14 / 25
We track the proportion of (ordered) pairs (i, j)
We focus on the transitions that modify i (equations are similar for j).
(i, j) 7→(i − 1, j) at rate 1
departure
Nicolas Gast – 15 / 25
We track the proportion of (ordered) pairs (i, j)
We focus on the transitions that modify i (equations are similar for j).
(i, j) 7→(i − 1, j) at rate 1

 λ if i < j
λ/2 if i = j
(i, j) 7→(i + 1, j) at rate

0 if i > j
departure
arrival on (i, j)
Nicolas Gast – 15 / 25
We track the proportion of (ordered) pairs (i, j)
We focus on the transitions that modify i (equations are similar for j).
(i, j) 7→(i − 1, j) at rate 1

 λ if i < j
λ/2 if i = j
(i, j) 7→(i + 1, j) at rate

0 if i > j
∞
X
1
(i, j) 7→(i + 1, j) at rate λ
zi,i,j +
z`,i,j /yij
2
`=i+1
|
{z
}
departure
arrival on (i, j)
arrival on (`, i),
=:pi
where z`,i,j is the proportion of triplets.
Nicolas Gast – 15 / 25
We track the proportion of (ordered) pairs (i, j)
We focus on the transitions that modify i (equations are similar for j).
(i, j) 7→(i − 1, j) at rate 1

 λ if i < j
λ/2 if i = j
(i, j) 7→(i + 1, j) at rate

0 if i > j
∞
X
1
(i, j) 7→(i + 1, j) at rate λ
zi,i,j +
z`,i,j /yij
2
`=i+1
|
{z
}
departure
arrival on (i, j)
arrival on (`, i),
=:pi
where z`,i,j is the proportion of triplets.
The pair approximation is z`,i,j ≈ y`,i yi,j /xi or:
P
Yii /2 + k>i Yki
P
pi ≈
.
k Yki
Nicolas Gast – 15 / 25
The pair approximation ODE is composed of four terms
Yij decreases at rate:
µYij
(departure)
λYi,j
(arrival on (i, j) when (i < j))
λYi,j /2
(arrival on (i, i) when i = j)
λpi Yi,j
(arrival on neighbor )
Nicolas Gast – 16 / 25
The pair approximation ODE is composed of four terms
Yij decreases at rate:
µYij
(departure)
2
k
λYi,j /k
λYi,j
λpi Yi,j 2
(arrival on (i, j) when (i < j))
(arrival on (i, i) when i = j)
k −1
k
(arrival on neighbor )
The equations can be generalized to graph with fixed degree k ≥ 2:
Nicolas Gast – 16 / 25
There is no (known) close-form for the fixed point...
Nicolas Gast – 17 / 25
...but we can simulate the ODE!
Nicolas Gast – 18 / 25
Outline
1
The classical two-choice model
2
Construction of the pair approximation equations
3
Numerical validation: the pair approximation is accurate!
4
Remarks and open questions
Nicolas Gast – 19 / 25
I compare numerically four values
Simu
Pair-approx
Simulation
Fixed point of the pair-approximation ODE
ODE of size 100 × 100.
No choice
Two-choice
Theory for the M/M/1 queue
xi = (1 − λ)λi
Theory (without geometry)
xi = λ2 − λ2
i
i+1
Nicolas Gast – 20 / 25
The fixed point of the pair-approximation is close to the
system’s steady-state (checked for λ = .5 to λ = .99)
0.40
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
0.35
0.30
frequency
0.25
0.20
0.15
0.10
0.05
0.00
0
5
10
queue length
15
20
λ = 0.7
Nicolas Gast – 21 / 25
The fixed point of the pair-approximation is close to the
system’s steady-state (checked for λ = .5 to λ = .99)
100
10-1
10-2
10-3
frequency
10-4
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-5
10-6
10-7
10-8
10-9
10-10
10-11
0
5
10
queue length
15
20
λ = 0.7
Nicolas Gast – 21 / 25
The fixed point of the pair-approximation is close to the
system’s steady-state (checked for λ = .5 to λ = .99)
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
0.14
0.12
frequency
0.10
0.08
0.06
0.04
0.02
0.00
0
5
10
15
queue length
20
25
30
λ = 0.95
Nicolas Gast – 21 / 25
The fixed point of the pair-approximation is close to the
system’s steady-state (checked for λ = .5 to λ = .99)
100
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-1
10-2
frequency
10-3
10-4
10-5
10-6
10-7
10-8 0
5
10
15
queue length
20
25
30
λ = 0.95
Nicolas Gast – 21 / 25
The fixed point of the pair-approximation is close to the
system’s steady-state (checked for λ = .5 to λ = .99)
100
10-2
10-3
10-1
10-3
10-4
10-4
10-5
10-5
10-6
10-7
10-8
10-8
λ = 0.5
10-9
10-10
0
5
10
queue length
100
10-2
20
10-11
frequency
10-5
λ = 0.99
10-4
10-5
10-7
20
20
10-3
10-6
15
15
10-2
10-7
10
queue length
10
queue length
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-6
5
5
100
10-4
0
0
10-1
λ = 0.9
10-3
frequency
15
10-9
10-10
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-1
10-8
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-6
10-7
10-11
λ = 0.7
10-2
frequency
frequency
100
Simulation (line)
Pair Approx
One choice
two-choice (non geom)
10-1
10-8 0
5
10
15
queue length
20
25
30
Nicolas Gast – 21 / 25
The (steady-state) average queue length is very well
approximated by pair-approximation
10
average queue length
8
6
4
Simulation (ring)
Simulation (2D torus)
Simu, FD(2)
Simu, FD(4)
Pair Approx (k=2)
Pair Approx (k=4)
One choice
mean-field approx.
2
0
0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00
ρ
Nicolas Gast – 22 / 25
Outline
1
The classical two-choice model
2
Construction of the pair approximation equations
3
Numerical validation: the pair approximation is accurate!
4
Remarks and open questions
Nicolas Gast – 23 / 25
Recap
I study a spatial version of the two-choice model.
Motivation comes from bike-sharing systems.
Without geometry, the problem
X can be solved by using
Xa mean-field
i
i
approximation (one-choice:
xj = λ , two-choice,
xj = λ2 −1 ).
j≥i
j≥i
Pair-approximation:
I
I
How to construct the equations
Numerically, they are very accurate
Nicolas Gast – 24 / 25
Open questions / Future work
Why does it work so well?
(in some other cases, e.g., SIR, it does not)
?
Is the pair approximation exact?
No
For a torus, is the decrease doubly-exponential?
P
i
(recall: two-choice without geometry: j≥i xj = λ2 −1 )
No?
Can we solve analytically the PA equations (or bound?)
?
Can we add heterogeneity?
seems OK
Non-exponential service time?
(maybe later)
Nicolas Gast – 25 / 25