graph/path_enumeration_utils library

Enumerate all simple paths between two nodes (roadmap #543).

A simple path visits no node more than once, so even cyclic graphs yield a finite set of paths and the DFS can never loop forever. Beware: the number of simple paths can grow exponentially, so bound dense graphs with enumeratePaths's maxDepth.

Functions

enumeratePaths(Adjacency graph, int start, int target, {int? maxDepth}) List<List<int>>
Every simple path from start to target, each path a node-index list.