🤖 AI Summary
This work addresses the problem of enumerating all geodesics—i.e., all shortest paths between every pair of vertices—in graphs, supporting both directed and undirected, as well as weighted and unweighted variants. We propose the first natural, output-sensitive enumeration algorithm with polynomial delay, overcoming the traditional exponential-complexity barrier. Our method employs a combinatorial graph traversal framework that integrates depth-first search with path-extension pruning to ensure efficiency, completeness, and duplicate-free enumeration, with verifiable correctness. Theoretically, the algorithm achieves polynomial delay—its per-output time is bounded by a polynomial function of the output size—while maintaining linear space complexity. Extensive experiments on real-world and synthetic graphs demonstrate strong scalability. This is the first algorithm to guarantee strict output-polynomial enumeration of geodesics, establishing a foundational tool for network analysis, centrality computation, and path-based mining tasks.
📝 Abstract
By"geodesic"we mean any sequence of vertices $(v_1,v_2,...,v_k)$ of a graph $G$ that constitute a shortest path from $v_1$ to $v_k$. We propose a novel, very natural (yet output-polynomial) algorithm to enumerate all geodesics of $G$. The graph can be directed or not, and weighted or not.