1 SOFSEM 2007 Weighted Nearest Neighbor Algorithms for the Graph Exploration Problem on Cycles Eiji...
-
Upload
micah-usery -
Category
Documents
-
view
216 -
download
1
Transcript of 1 SOFSEM 2007 Weighted Nearest Neighbor Algorithms for the Graph Exploration Problem on Cycles Eiji...
1
SOFSEM 2007
Weighted Nearest Neighbor Algorithms for the Graph Exploration Problem on Cycles
Eiji Miyano
Kyushu Institute of Technology, Japan
Joint work with
Yuichi Asahiro, Shuichi Miyazaki, and Takuro Yoshimuta
2
Overview
Problems Related problem: Traveling Salesperson Problem (TSP) Our problem: Online Graph Exploration Problem
Simple online algorithms and their performances Our algorithm: Weighted nearest neighbor algorithm Main results
1.5 competitive algorithm for special graphs, ie., cycles 1.5 tight example 1.25 lower bound for deterministic online algorithms
Conclusions
3
One of the most popular problems
Traveling Salesperson Problem, TSP(more precisely, the shortest tour problem)Input: We in advance have the complete
map of an input graph, i.e., the origin node o, the number of nodes, the number of edges, the length of every edge, and the topology.
Goal: Minimize the total distance of the traveled
tour, beginning at the origin o, visiting allthe nodes at least once, and finally returningto the origin o.
origin3
3
4
2
3
7
4
3
5
5
1
8
4
One of the most popular problems
Traveling Salesperson Problem, TSP(more precisely, the shortest tour problem)Input: We in advance have the complete
map of an input graph, i.e., the origin node o, the number of nodes, the number of edges, the length of every edge, the topology.
Goal: Minimize the total distance of the traveled
tour, beginning at the origin o, visiting allthe nodes at least once, and finally returningto the origin o.
origin3
3
4
2
3
7
4
3
5
5
1
Total distance = 36
8
3
5
Our problem
Online Graph Exploration ProblemInitial Information: Only the partial information of
the map is given, i.e.,the searcher knows only the origin o its neighbor nodes the length of edge (o, u) for
each neighbor node u
By using the partial information,the searcher has to select the next nodeand visit it.
origin
u
35
???
searcher
6
Our problem
Online Graph Exploration ProblemInitial Information: Only the partial information of
the map is given the origin o its neighbor nodes the length of edge (o, u) for
each neighbor node u
Online New Information: When the searcher visits a node u,
its neighbor nodes v’s, and the lengthof edges (u, v)’s are obtained.
origin
u
35
4
8
???
7
Our problem
Online Graph Exploration ProblemInitial Information: Only the partial information of
map is given the origin o its neighbor nodes the length of edge (o, u) for
each neighbor node uOnline Information: When the searcher visits a node u,
its neighbor nodes v’s, and the lengthof edges (u, v)’s are obtained.
Goal: Minimize the total distance of the traveled tour,
beginning at the origin o, visiting all the nodesat least once, and returning to the origin o.
35
4
8 3
7
3
5
???
8
Quality of an online algorithm
Competitive analysis Let OPT(G) denote the total length of the shortest exploring tour of G
taken by an optimal offline algorithm OPT. Let ALG(G) denote the total length of the exploring tour of G taken by
algorithm ALG.
We say that ALG is -competitive for a class of graphs G if
for all graphs G G.
The ratio is called the competitive ratio.
ALG is competitive if ALG is c-competitive for some constant c.
)(OPT)(ALG GG
9
Strategy 1:
Nearest Neighbor Algorithm (NN) always chooses the unvisited new node nearest to the
current position.
NN is Bad [RSL97] There is a planar graph G (with n nodes) for which
origin
1
24
origin3
2
81
10
ab
a
b
)(log)(
)(n
GOPT
GNN
10
NN is bad
There is a planar graph G for which
[RSL97]
)(log)(
)(n
GOPT
GNN
origin2
2
2
2
2
2
2
11
11
1
1
1
1
6
6
2
103
3
3
3
OPT(G) = 32NN(G) = 66
Generally,OPT(G) = nNN(G) = (nlog n)
11
Strategy 2:
Depth-First algorithm (DF) Basically, if the current node has new edges, then
DF always chooses one of them. Otherwise, DF chooses the nearest new edge.
Proposition 1
DF is 1-competitive (optimal) for trees, i.e., graphs without loops.
a
b
o
d
1origin
c
782
12
DF is bad
Basically, if the current node has new edges, thenDF always chooses one of them.
Otherwise, DF chooses the nearest new edge.
Proposition 1’
DF is not competitive even for cycles.
13
DF is bad
Basically, if the current node has new edges, thenDF always chooses one of them.
Otherwise, DF chooses the nearest new edge.
Proposition 1’
DF is not competitive even for cycles.
Proof.
If the graph includes cycles, the problem would become non-trivial.
1
1 100
1
origin
OPT(G) = 6DF(G) = 103
14
Best previous algorithm
ShortCut algorithm: proposed by Kalyanasundarama and Pruhs (TCS 130, 199
4). It is shown that ShortCut achieves the competitive ratio of 1
6 for planar graphs.
Basic strategy of ShortCut: the weighted nearest neighbor strategy (WNN).
What is WNN?
16)graphplanar(OPT
)graphplanar(ShortCut
15
Weighted Nearest Neighbor Algorithm
Suppose that the searcher is currently on u.
Weighted Nearest Neighbor WNN If d1 + d2 < d3, then
the searcher visits y; Otherwise,
the searcher visits v.
Nearest Neighbor NN sets = 1 WNN1
x y
u v
explored area
d3
d1
d2
16
Weighted Nearest Neighbor Algorithm
Suppose that the searcher is currently on u.
Weighted Nearest Neighbor WNN If d1 + d2 < d3, then
the searcher visits y; Otherwise,
the searcher visits v.
Nearest Neighbor NN sets = 1, i.e., WNN1
visits v since 99 +50 > 55 worst case: its competitive ratio is (log n)
x y
u v
explored area
55
99
50
17
Weighted Nearest Neighbor Algorithm
Suppose that the searcher is currently on u.
Weighted Nearest Neighbor WNN If d1 + d2 < d3, then
the searcher visits y; Otherwise,
the searcher visits v.
ShortCut [KP94] sets = 3, WNN3
visits y since 99 + 50 < 3 50 its competitive ratio is 16 for planar graphs
x y
u v
explored area
55
99
50
18
This paper
Focuses the WNN strategy, Applies WNN to cycles, Investigates its ability more intensively.
Weighted Nearest Neighbor WNN If d1 + d2 < d3, then
the searcher visits y; Otherwise,
the searcher visits v.
x y
u v
explored area
d3
d1
d2
19
Our problem
Online Graph Exploration Problem for CyclesInitial Information: Only the partial information of
map is given the origin o its neighbor nodes the length of edge (o, u) for
each neighbor node uOnline Information: When the searcher visits a node u,
its neighbor nodes v’s, and the lengthof edges (u, v)’s are obtained.
Goal: Minimize the total distance of the tour,
beginning at o, visiting all the nodesat least once, and returning to o.
???
The gray area is a simple path,but the searcher does not knowits shape.
20
Summary of Our Results
Upper bounds for cycles: NN (i.e., WNN1) achieves the competitive ratio of 1.5 for
cycles. Our analysis of the 1.5-competitive ratio is tight since we can
provide an instance for which the bound of 1.5 is attained.
Lower bounds for WNN: Setting = 1 for WNN is the best for cycles, i.e.,
if 1, the competitive ratio of WNN is at least 1.5.
Lower bound for general algorithms. No deterministic online algorithm has a competitive ratio less
than 1.25.
21
Cycles
Let C = (V, E, l) be a cycle with |V| = n, |E| = n, andedge-length l(e).
Let L be the sum of the length of all edges in E. Let lmax be the maximum edge length
1 2
1
3
4
2
13
242311
L
4max l
22
Optimal Tour
If the graph is a cycle, an optimal tour forms either a simple cycle including all n edges, or a U-turn tour including n – 1 different edges.
4
3 1
2
52
Ll
L
l
21
max
max
17
5
17
)(
LGOPT
4
3 1
200
52
Ll
L
l
21
max
max
215
200
30
)(2)( max
lLGOPT
23
Our Result (1)
Theorem 1:
WNN1 is 1.5-competitive for cycles.
Proof. There are two cases:
(Case 1) lmax < L/2 OPT(G) = L
OPT
24
Our Result (1)
Theorem 1:
WNN1 is 1.5-competitive for cycles.
Proof. There are two cases:
(Case 1) lmax < L/2 OPT(G) = L WNN1 needs at most L to visit all nodes,
and at most L/2 to go back to the origin.
L
LLWNN
23
21
1
5.12
323
L
L
WNN1
21
1
5
10
25
Our Result (1)
Theorem 1:
WNN1 is 1.5-competitive for cycles.
Proof. Ttwo cases:
(Case 2) lmax >= L/2
OPT(G) = 2(L – lmax)
WNN1 needs at most 2(L – lmax) to visitall nodes, and at most (L – lmax) to goback to the origin.
)(3
)()()(
max
maxmaxmax1
lL
lLlLlLWNN
5.12
3
)(2
)(3
max
max
lL
lL
26
Our Result (2)
Theorem 2:
For any , the competitive ratio of WNN is at least 1.5 for cycles.
Theorem 1:
WNN1 is 1.5-competitive for cycles.
From Theorems 1 and 2, it can be obtained that Setting =1 for WNN is the best for cycles.
27
Our Result (2)
Theorem 2:
For any , the competitive ratio of WNN is at least 1.5 for cycles.
Proof.
This theorem is shown by Lemmas 1 and 2:
Lemma 1:
For 0 < < 1, the competitive ratio of WNN exceeds 1.5.
Lemma 2:
For 1 <= , the competitive ratio of WNN is at least 1.5.
28
Lemma 1
Lemma 1:
For 0 < < 1, the competitive ratio of WNN exceeds 1.5.
Proof. Construct a hard cycle C such that
the searcher of WNN goes through the longest edge, and
the searcher goes through the explored edges several times, but
OPT does not go through thelongest edge.
ox q p1 p2 y
maxl
pk
29
Lemma 1
Lemma 1:
For 0 < < 1, the competitive ratio of WNN exceeds 1.5.
Proof. Construct a hard cycle C such that
the searcher of WNN goes through the longest edge, and
the searcher goes through the explored edges several times, but
OPT does not go through thelongest edge.
ox q p1 p2 y
maxl
pk
30
Lemma 1
Lemma 1:
For 0 < < 1, the competitive ratio of WNN exceeds 1.5.
Proof. Construct a hard cycle C such that
the searcher of WNN goes through the longest edge, and
the searcher goes through the explored edges several times, but
OPT does not go through thelongest edge.
ox q p1 p2 y
maxl
pk
5.11
2
8)1(
8)2(
L
L
OPT
WNN
Ll 21
max
31
Lemma 2
Lemma 2:
For 1 <= , the competitive ratio of WNN is at least 1.5.
Proof. Construct a different hard cycle C such that
the searcher of WNN goes through the explored edges
many times, but OPT goes through every edge
exactly once.
o b1a1a2 b2am bm
)1(5.1
)12(2
))1(222(32
2
o
m
OPT
WNNm
m
32
Theorems 1 and 2
Theorem 1:
WNN1 is 1.5-competitive for cycles.
Theorem 2:
For any , the competitive ratio of WNN is at least 1.5.
As a result, Setting =1 for WNN is the best for cycles.
33
Our Result (3)
Theorem 3:
No online graph exploration algorithm has a competitive ratio less than 1.25.
Proof. Consider two cycles.
1
3 3
1 1
3 ε0
1a a
b
c
d b
c
d
25.18
10
OPT
ALG
25.124
5
0
0
OPT
ALG
34
Summary and Future Work
Result 1: Upper and tight bounds for cycles NN (i.e.,WNN1) achieves the competitive ratio of 1.5 for cycles. Our analysis of the 1.5-competitive ratio is tight since we can provide an
instance for which the bound of 1.5 is attained.
Result 2: Lower bound for general algorithms No deterministic online algorithm has a competitive ratio less than 1.25.
Future Work Different good online strategy for cycles. Smaller competitive ratio than 16 for planar graphs. Larger lower bound than 1.25 for general algorithms. Competitive algorithm for general graphs.
35
Summary and Future Work
Result 1: Upper and tight bounds for cycles NN (i.e.,WNN1) achieves the competitive ratio of 1.5 for cycles. Our analysis of the 1.5-competitive ratio is tight since we can provide an
instance for which the bound of 1.5 is attained.
Result 2: Lower bound for general algorithms No deterministic online algorithm has a competitive ratio less than 1.25.
Future Work Different good online strategy for cycles. Smaller competitive ratio than 16 for planar graphs. Larger lower bound than 1.25 for general algorithms. Competitive algorithm for general graphs. Thank you.