A Streaming Algorithm for the Undirected Longest Path Problem

We present the first streaming algorithm for the longest path problem in undirected graphs. The input graph is given as a stream of edges and RAM is limited to only a linear number of edges at a time (linear in the number of vertices n ). We prove a per-edge processing time of O ( n ) , where a naive solution would have required Ω( n 2 ) . Moreover, we give a concrete linear upper bound on the number of bits of RAM that are required. On a set of graphs with various structure, we experimentally compare our algorithm with three leading RAM algorithms: Warnsdorf (1823), Pohl-Warnsdorf (1967), and Pongracz (2012). Although conducting only a small constant number of passes over the input, our algorithm delivers competitive results: with the exception of preferential attachment graphs, we deliver at least 71% of the solution of the best RAM algorithm. The same minimum relative performance of 71% is observed over all graph classes after removing the 10% worst cases. This comparison has strong meaning, since for each instance class there is one algorithm that on average delivers at least 84% of a Hamilton path. In some cases we deliver even better results than any of the RAM algorithms.

[1]  Joan Feigenbaum,et al.  On graph problems in a semi-streaming model , 2005, Theor. Comput. Sci..

[2]  Andreas Björklund,et al.  Narrow sieves for parameterized paths and packings , 2010, J. Comput. Syst. Sci..

[3]  Andreas Björklund Determinant Sums for Undirected Hamiltonicity , 2014, SIAM J. Comput..

[4]  Amin Vahdat,et al.  Hyperbolic Geometry of Complex Networks , 2010, Physical review. E, Statistical, nonlinear, and soft matter physics.

[5]  B. Monien How to Find Long Paths Efficiently , 1985 .

[6]  Albert,et al.  Emergence of scaling in random networks , 1999, Science.

[7]  Harold N. Gabow,et al.  Finding paths and cycles of superpolylogarithmic length , 2004, STOC '04.

[8]  Harold N. Gabow,et al.  Finding Long Paths, Cycles and Circuits , 2008, ISAAC.

[9]  Ioannis Koutis,et al.  Faster Algebraic Algorithms for Path and Packing Problems , 2008, ICALP.

[10]  Ziv Bar-Yossef,et al.  Reductions in streaming algorithms, with an application to counting triangles in graphs , 2002, SODA '02.

[11]  A. J. M. van Gasteren,et al.  On computing a longest path in a tree , 2002, Inf. Process. Lett..

[12]  Henning Meyerhenke,et al.  Fast generation of complex networks with underlying hyperbolic geometry , 2015 .

[13]  Rajeev Motwani,et al.  Approximating the Longest Cycle Problem in Sparse Graphs , 2002, SIAM J. Comput..

[14]  Ryan Williams,et al.  Finding paths of length k in O*(2k) time , 2008, Inf. Process. Lett..

[15]  Data Streams : Algorithms and Applications 1 , 2022 .

[16]  Sanjeev Khanna,et al.  Approximating Longest Directed Paths and Cycles , 2004, ICALP.

[17]  Asghar Asgharian-Sardroud,et al.  A linear-time algorithm for the longest path problem in rectangular grid graphs , 2012, Discret. Appl. Math..

[18]  Andreas Björklund,et al.  Finding a Path of Superlogarithmic Length , 2002, ICALP.

[19]  Zsolt Tuza,et al.  On the Approximation of Finding A(nother) Hamiltonian Cycle in Cubic Hamiltonian Graphs , 1999, J. Algorithms.

[20]  Nicolae Tapus,et al.  A Linear Time Algorithm for Computing Longest Paths in Cactus Graphs , 2012 .

[21]  J. Feigenbaum,et al.  Graph Distances in the DataStream Model , 2015 .

[22]  Ryuhei Uehara,et al.  On Computing Longest Paths in Small Graph Classes , 2007, Int. J. Found. Comput. Sci..

[23]  Venkatesan Guruswami,et al.  Superlinear Lower Bounds for Multipass Graph Processing , 2013, Computational Complexity Conference.

[24]  Sanjeev Khanna,et al.  Approximating Longest Directed Path , 2003, Electron. Colloquium Comput. Complex..

[25]  David R. Karger,et al.  On approximating the longest path in a graph , 1997, Algorithmica.

[26]  Sundar Vishwanathan,et al.  An approximation algorithm for finding a long path in Hamiltonian graphs , 2000, SODA '00.

[27]  L. Stockmeyer,et al.  Pohl-Warnsdorf – Revisited , 2004 .