350 likes | 488 Views
This paper explores a novel approach to the Online Graph Exploration Problem, focusing on cycles. Established algorithms like Nearest Neighbor and Depth-First have limitations, particularly in cyclic graphs. We introduce the Weighted Nearest Neighbor Algorithm, achieving competitive ratios of 1.5 for special graphs (i.e., cycles) and demonstrating a 1.25 lower bound for deterministic algorithms. The results are contextualized in relation to the Traveling Salesperson Problem, showcasing the algorithm's performance with respect to partial information available during exploration.
E N D
SOFSEM 2007Weighted 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
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
One of the most popular problems Traveling Salesperson Problem, TSP (more precisely, the shortest tour problem) Input: • We in advance have the completemap 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 traveledtour, beginning at the origin o, visiting allthe nodes at least once, and finally returningto the origin o. origin 5 3 5 4 8 3 3 7 2 1 4 3
One of the most popular problems Traveling Salesperson Problem, TSP (more precisely, the shortest tour problem) Input: • We in advance have the completemap 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 traveledtour, beginning at the origin o, visiting allthe nodes at least once, and finally returningto the origin o. origin 5 3 5 4 8 3 3 7 2 1 4 3 3 Total distance = 36
Our problem Online Graph Exploration Problem Initial Information: • Only the partial information ofthe map is given, i.e.,the searcher knows only • the origin o • its neighbor nodes • the length of edge (o, u) foreach neighbor node u • By using the partial information,the searcher has to select the next nodeand visit it. searcher origin 5 3 u ???
Our problem Online Graph Exploration Problem Initial Information: • Only the partial information ofthe map is given • the origin o • its neighbor nodes • the length of edge (o, u) foreach 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 5 3 u 4 8 ???
Our problem Online Graph Exploration Problem Initial Information: • Only the partial information of map is given • the origin o • its neighbor nodes • the length of edge (o, u) foreach neighbor node u Online 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. 5 3 5 4 8 3 3 7 ???
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.
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 10 1 a origin 2 8 4 2 1 a b 3 origin b
NN is bad • There is a planar graph G for which [RSL97] 2 origin 1 OPT(G) = 32 NN(G) = 66 2 2 1 1 1 2 3 3 10 3 6 1 2 2 1 2 1 Generally, OPT(G) = n NN(G) = (nlog n) 3 6 2 1
Strategy 2: Depth-First algorithm (DF) • 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 1-competitive (optimal) for trees, i.e., graphs without loops. 1 origin o a 8 2 7 d b c
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.
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. origin 1 100 OPT(G) = 6 DF(G) = 103 1 1
Best previous algorithm ShortCut algorithm: • proposed by Kalyanasundarama and Pruhs (TCS 130, 1994). • It is shown that ShortCut achieves the competitive ratio of 16 for planar graphs. Basic strategy of ShortCut: • the weighted nearest neighbor strategy (WNN). • What is WNN?
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 d1 y x d2 explored area u v d3
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) 99 y x 50 explored area u v 55
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 99 y x 50 explored area u v 55
This paper • Focuses the WNN strategy, • Applies WNN to cycles, • Investigates its ability more intensively. Weighted Nearest Neighbor WNN • If d1 + d2 < d3, thenthe searcher visits y; • Otherwise,the searcher visits v. d1 y x d2 explored area u v d3
Our problem Online Graph Exploration Problem for Cycles Initial Information: • Only the partial information ofmap is given • the origin o • its neighbor nodes • the length of edge (o, u) foreach neighbor node u Online 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 know its shape.
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.
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 4 3 2
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. 2 5 2 5 4 2 4 200 3 1 3 1
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
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. WNN1 1 2 10 1 5
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.
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.
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.
o x q y p1 p2 pk 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.
o x q y p1 p2 pk 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.
o x q y p1 p2 pk 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.
bm o b1 a1 a2 b2 am 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 edgeexactly once.
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.
Our Result (3) Theorem 3: No online graph exploration algorithm has a competitive ratio less than 1.25. Proof. Consider two cycles. a a 1 1 1 1 d b d b 3 ε0 3 3 c c
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.
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.