DAG path enumeration
Posted: Sat Oct 13, 2007 8:05 am
Given a DAG (directed acyclic graph), a start and end vertex, enumerate all path lengths between them. What is the fastest algorithm? The best I've seen is to use matrix multiplication which is O(n^e(logn)) where e is the exponent for matrix multiplication. Is there a O(n^2 logn) solution? n is number of vertices. BFS seem to take O(n^3) times on this problem.
Note this is different from counting the number of paths between the two vertices, which can be done in O(E) time with topological sort.
Note this is different from counting the number of paths between the two vertices, which can be done in O(E) time with topological sort.