Efficient Algorithms for Optimal Location Queries in Road Networks Zitong Chen (Sun Yat-Sen University) Yubao Liu (Sun Yat-Sen University) Raymond Chi-Wing Wong (Hong Kong University.
Download
Report
Transcript Efficient Algorithms for Optimal Location Queries in Road Networks Zitong Chen (Sun Yat-Sen University) Yubao Liu (Sun Yat-Sen University) Raymond Chi-Wing Wong (Hong Kong University.
Efficient Algorithms for Optimal
Location Queries in Road
Networks
Zitong Chen (Sun Yat-Sen University)
Yubao Liu (Sun Yat-Sen University)
Raymond Chi-Wing Wong (Hong Kong University of Science and Technology)
Jiamin Xiong (Sun Yat-Sen University)
Ganlin Mai (Sun Yat-Sen University)
Cheng Long (Hong Kong University of Science and Technology)
Presented by Raymond Chi-Wing Wong
Prepared by Raymond Chi-Wing Wong
1
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
2
1. Introduction
hospitals
S = {s1, s2}
residential estates
C = {c1, c2}
v2
v1
c1
v3
s1
v4 s
2
c2
v5
v6
3
1. Introduction
hospitals
S = {s1, s2}
residential estates
C = {c1, c2}
nearest hospital = s1
6
v2
v1
Suppose that we want to build a
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
c1 2 v
3
Where should we set up?
4
s1
v4 s
2
5
c2
v5
v6
nearest hospital = s2 5
maximum distance between a
residential estate and its nearest
hospital = 6
Observation 1: Placing a new hospital at some
locations cannot reduce the maximum distance
between a residential estate and its nearest
hospital
Placement 1
6
1. Introduction
hospitals
S = {s1, s2}
residential estates
C = {c1, c2}
nearest hospital = s1
6
v2
v1
c1 2 v
3
Suppose that we want to build a
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
Placement 1
Suppose that we build a new
hospital here
s
4
s1
v4 s
2
5
c2
v5
v6
nearest hospital = s2 5
maximum distance between a
residential estate and its nearest
hospital = 6
Observation 1: Placing a new hospital at some
locations cannot reduce the maximum distance
between a residential estate and its nearest
hospital
Placement 1
6
Placement 2
5
1.
Introduction
Observation 2: Placing a new hospital at some
locations can reduce the maximum distance
hospitals
between
estate
and its nearest
S = a{sresidential
,
s
}
1
2
hospital
residential estates
C = {c1, c2}
nearest hospital = ss1
5
6
v2 2
v1
c1 2 v
3
v4 s
2
5
c2
2 v5
Placement 2
Suppose that we build a new
hospital here
3
s
2
Suppose that we want to build a
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
4
s1
v6
5
nearest hospital = ss2 4
maximum distance between a
residential estate and its nearest
hospital = 65
Observation 1: Placing a new hospital at some
locations cannot reduce the maximum distance
between a residential estate and its nearest
hospital
1.
Introduction
Observation 2: Placing a new hospital at some
locations can reduce the maximum distance
hospitals
between
estate
and its nearest
S = a{sresidential
,
s
}
1
2
hospital
residential estates
C = {c1, c2}
nearest hospital = ss1
4.5
6
v2 2
v1
2.5
s
2.5
v4 s
2
5
c2
2 v5
c1 2 v
3
Placement 1
6
Placement 2
5
Placement 3
4.5
Which placement is better?
Suppose that we want to build a
Placement 3
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
Placement 3
Suppose that we build a new
hospital here
4
s1
v6
5
nearest hospital = ss2 4.5
maximum distance between a
residential estate and its nearest
hospital = 64.5
Optimal location query
1. Introduction
The MinMax Query
Emergency applications
(such as hospitals, police
hospitals
S
=
{s
,
s
}
2 fire stations)
stations1 and
residential estates
C = {c1, c2}
nearest hospital = ss1
4.5
6
v2 2
v1
2.5
s
2.5
v4 s
2
5
c2
2 v5
c1 2 v
3
Problem: We want to find a
location for the new hospital so
that the maximum distance
between a residential estate and
its nearest hospital is minimized.
Suppose that we want to build a
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
Placement 3
Suppose that we build a new
hospital here
4
s1
v6
5
nearest hospital = ss2 4.5
maximum distance between a
residential estate and its nearest
hospital = 64.5
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
9
Problem: We want to find a
location for the new hospital so
that the maximum distance
between a residential estate and
its nearest hospital is minimized.
2. Problem Definition
After we define the problem, we need
to give some concepts
10
Problem: We want to find a
location for the new hospital so
that the maximum distance
between a residential estate and
its nearest hospital is minimized.
2. Problem Definition
A set of points on the road
hospitals
network
at
S = with
{s1, sdistances
}
most c2.dist 2
C = {c1, c2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
3
Suppose that we want to build a
new hospital so that the distance
between each residential estate
to its nearest hospital is as small
as possible.
Nearest location component (NLC)
NLC of c1
NLC of c2
4
s1
v4 s
2
5
c2
v5
v6
c2.dist
nearest hospital = s2 5
A set of points on the road
network with distances at
most c1.dist
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
12
3. Related Work
Optimal Location Queries with Non-Road
Network Setting
Optimal Location Queries with Road
Network Setting
Best-known Method Proposed in ICDE 2011
13
3. Related Work
Best-known Method Proposed in ICDE 2011
It is very time-consuming
For each client/server,
it creates a vertex in the road network
It creates a larger road network
It solves the optimal location query with this
larger road network
However, our MinMax-Alg does not
need to generate this larger road
network
14
3. Related Work
Best-known Method Proposed in ICDE 2011
Time Complexity
O((|V|+|S|+|C|)2log (|V|+|S|+|C|))
where |V| is the number of vertices, |S| is the
number of servers and |C| is the number of clients
The time complexity of our method =
O(|V|log|V|+|V||C|log|C|)
where is a small number at most |C|
(e.g., in SF, = 27 but |C| = 300k)
15
3. Related Work
In our experiment,
Our MinMax-Alg runs within 3 minutes only
The best-known method runs for more
than 10 hours
At least 200 times faster
16
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
17
4. Algorithm
hospitals
S = {s1, s2}
C = {c1, c2}
nearest hospital = s1
v1
Assume that all clients are sorted in
descending order of their costs.
That is, Cost(c1) ≥ Cost(c2)
residential estates
c1.dist
Cost(c1)
6
c1 2 v
v2
3
NLC of c1
NLC of c2
4
s1
v4 s
2
5
c2
v5
v6
c2.dist
nearest hospital = s2 5
Cost(c2)
4. Algorithm
e.g.1
S = {s1, s2}
hospitals
C = {c1, c2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
3
A set of points on the road
network with distances at
most 5
4
Shrinking NLC of c1 wrt 5
NLC(c1, 5)
A set of points on the road
network with distances at
most 5
s1
v4 s
2
5
NLC(c2, 5)
c2
v5
v6
c2.dist
nearest hospital = s2 5
Shrinking NLC of c2 wrt 5
4. Algorithm
No. of clients
Given an integer m in [1, 2] and a nonnegative real number C,
the (m, C)-critical intersection is defined to
m
be
NLC ( c
j
,C)
j 1
20
(m, C)-Critical Intersection
Note that Cost(c2)=5
It can be re-written as
(2, Cost(c2))-Critical Intersection
4. Algorithm
e.g.1
S = {s1, s2}
(2, 5)-Critical Intersection
2
=
hospitals
C = {c1, c2}
nearest hospital = s1
v1
NLC ( c
residential estates
c1.dist
6
c1 2 v
v2
NLC(c1, 5)
s1
NLC(c2, 5)
c2
v5
v6
c2.dist
nearest hospital = s2 5
Shrinking NLC of c2 wrt 5
,5 ) NLC ( c1 , 5 ) NLC ( c 2 , 5 )
Shrinking NLC of c1 wrt 5
4
5
j
j 1
3
v4 s
2
C=5
m=2
4. Algorithm
e.g.
No. of clients
The critical number denoted by mo is
defined to be the greatest integer in [1, 2]
such that (mo, Cost(cmo))-critical
intersection is non-empty.
m=1
Is the (1, Cost(c1))-Critical Intersection non-empty?
Yes
m=2
Is the (2, Cost(c2))-Critical Intersection non-empty?
Yes
Conclusion: 2 is the critical number mo
22
(m, C)-Critical Intersection
Note that Cost(c2)=5
It can be re-written as
(2, Cost(c2))-Critical Intersection
4. Algorithm
e.g.1
S = {s1, s2}
(2, 5)-Critical Intersection
2
=
hospitals
C = {c1, c2}
nearest hospital = s1
v1
NLC ( c
residential estates
c1.dist
6
c1 2 v
v2
NLC(c1, 5)
s1
NLC(c2, 5)
c2
v5
v6
c2.dist
nearest hospital = s2 5
Shrinking NLC of c2 wrt 5
,5 ) NLC ( c1 , 5 ) NLC ( c 2 , 5 )
Shrinking NLC of c1 wrt 5
4
5
j
j 1
3
v4 s
2
C=5
m=2
2 is the greatest integer
such that (2, Cost(c2))critical intersection is nonempty.
2 is the critical number mo.
4. Algorithm
Lemma: There exists an optimal
location po in the (mo, Cost(cmo))-critical
intersection.
In our running example, we know that 2 is the critical number mo.
According to this lemma, there exists an optimal location po in the
(2, Cost(c2))-critical intersection.
24
We know that 2 is the critical number.
According to this lemma, there exists an optimal location po in the
(2, Cost(c2))-critical intersection.
4. Algorithm
e.g.1
S = {s1, s2}
hospitals
C = {c1, c2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
NLC(c1, 5)
3
(2, Cost(c2))-Critical Intersection
4
s1
v4 s
2
5
NLC(c2, 5)
c2
v5
v6
c2.dist
nearest hospital = s2 5
4. Algorithm
Two-Step Algorithm
Step 1 (Finding Critical Number mo)
Find the critical number mo
Step 2 (How to Find Optimal Location
in Critical Intersection)
Find the optimal location in the (mo, Cost(cm ))critical intersection
o
26
4. Algorithm
Enhancement
When we encounter some scenarios, we do
not need to perform Step 2 (which can
speed up the computation)
Details are skipped
27
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
28
5. Empirical Study
Road Network
SF (San Francisco) (High Resolution)
174,955 vertices
223,000 edges
1000 servers
300,000 clients
29
5. Empirical Study
Measurements
Execution Time
Memory
Algorithms
MinMax-Alg
best-known
30
5. Empirical Study
31
5. Empirical Study
32
Outline
1.
2.
3.
4.
5.
6.
Introduction
Problem Definition
Related Work
Algorithm
Empirical Study
Conclusion
33
6. Conclusion
Study the Optimal Location Query
MinMax Query
Propose an efficient algorithm which is
much faster than the best-known
algorithm (more than 200 times faster
in some experiments)
34
6. Conclusion
We studied Three Extensions
Optimal Location Queries with Multiple
Locations
Optimal Location Queries on 3D Terrain
Optimal Location Queries with another cost
(Maximize the total number of clients
attracted by servers)
35
Q&A
36
37
5. Empirical Study
Road Network
SF (San Francisco) (High Resolution)
174,955 vertices
223,000 edges
1000 servers
300,000 clients
CA (California) (Low Resolution)
21,047 vertices
21,692 edges
250 servers
40,000 clients
38
5. Empirical Study
Two Sets of Experiments
Experiments for the MinMax query
Experiments for the MaxSum query
39
5. Empirical Study
Second Set: Experiment for the MaxSum query
40
4. Algorithm
e.g.2
S = {s1, s2}
hospitals
C = {c1, c2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
3
A set of points on the road
network with distances at
most 3
v4 s
2
5
NLC(c2, 3)
c2
v5
4
Shrinking NLC of c1 wrt 3
NLC(c1, 3)
A set of points on the road
network with distances at
most 3
s1
v6
c2.dist
nearest hospital = s2 5
Shrinking NLC of c2 wrt 3
(m, C)-Critical Intersection
4. Algorithm
e.g.2
S = {s1, s2}
(2, 3)-Critical Intersection
2
=
hospitals
C = {c1, c2}
nearest hospital = s1
v1
NLC ( c
residential estates
c1.dist
6
c1 2 v
v2
NLC(c1, 3)
s1
NLC(c2, 3)
c2
v5
v6
c2.dist
nearest hospital = s2 5
Shrinking NLC of c2 wrt 3
,3 ) NLC ( c1 , 3 ) NLC ( c 2 , 3 )
Shrinking NLC of c1 wrt 3
4
5
j
j 1
3
v4 s
2
C=3
m=2
4. Algorithm
Concepts
Cost
Shrinking NLC
Critical Intersection
Critical Number
Algorithm
Enhancement
43
4. Algorithm
Enhancement
Concept
Method
44
4. Algorithm
We define R to be the (mo, Cost(cmo-1))critical intersection.
45
4. Algorithm
Enhancement
Concept
Method
46
4. Algorithm
Lemma: Suppose that mo < n. If R is
non-empty, (1) costo = Cost(cmo+1), and
(2) when a new server is set up at any
location in R, the maximum cost of a
client is equal to costo. If R is empty,
then Cost(cmo+1) < costo <= Cost(cmo)
47
4. Algorithm
Two-Step Algorithm
Step 1 (Finding Critical Number mo)
Find the critical number mo
Step 2 (a)
If mo < n, then we check whether R is empty
or not. If not, we immediately return R. If yes,
we find the optimal location in the (mo,
Cost(cm ))-critical intersection
o
Step 2 (b)
We find the optimal location in the (mo,
Cost(cm ))-critical intersection
o
48
4. Algorithm
Step 1 is straightforward
Step 2 is described as follows.
49
d(c, p)
6.0
5.0
4. Algorithm
e.g.1
S = {s1, s2}
4.0
3.0
2.0
1.0
hospitals
C = {c1, c2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
0
p1
0.5 1.0 1.5
p2
d(p1, p)
NLC(c1, 5)
3
(2, Cost(c2))-Critical Intersection
p2
4
p1
v4 s
2
5
NLC(c2, 5)
c2
s1
v5
v6
c2.dist
nearest hospital = s2 5
d(c, p)
6.0
5.0
4. Algorithm
e.g.1
S = {s1, s2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
0
p1
0.5 1.0 1.5
p2
d(p1, p)
NLC(c1, 5)
3
d(c1, p2) = 4.5
5
(2, Cost(c2))-Critical Intersection
p2
4
p1
d(c1, p1) = 5
v4 s
2
4.0
3.0
2.0
1.0
hospitals
C = {c1, c2}
c1
c2
s1
v5
v6
d(c, p)
6.0
5.0
4. Algorithm
e.g.1
S = {s1, s2}
nearest hospital = s1
v1
c2
4.0
3.0
2.0
1.0
hospitals
C = {c1, c2}
c1
residential estates
c1.dist
6
c1 2 v
v2
0
p1
0.5 1.0 1.5
p2
d(p1, p)
NLC(c1, 5)
3
d(c2, p2) = 4.5
p2
5
NLC(c2, 5)
4
p1
d(c2, p1) = 4
v4 s
2
(2, Cost(c2))-Critical Intersection
c2
s1
v5
v6
c2.dist
nearest hospital = s2 5
d(c, p)
6.0
5.0
4. Algorithm
e.g.1
S = {s1, s2}
nearest hospital = s1
v1
residential estates
c1.dist
6
c1 2 v
v2
3
d(c2, p2) = 4.5
v4 s
2
5
NLC(c2, 5)
4
p1
c2
, p)
0.5 1.0 1.5 Find d(p
the1point
p2 along this line
with the
smallest d(c, p)
NLC(c1, 5)
value
0
p1
(2, Cost(c2))-Critical Intersection
p2
d(c2, p1) = 4
c2
4.0
3.0
2.0
1.0
hospitals
C = {c1, c2}
c1
Maximum
distance
between a
client and its
closest server
s1
v5
v6
c2.dist
nearest hospital = s2 5
4. Algorithm
d(c, p)
6.0
5.0
d(c, p)
6.0
5.0
c1
4.0
3.0
2.0
1.0
4.0
3.0
2.0
1.0
c2
0
p1
c1
0.5 1.0 1.5
p2
d(p1, p)
c2
0
p1
c3
0.5 1.0 1.5
d(p1, p)
p2
54