Open mpadge opened 4 years ago
The current code does not return a minimal cycle basis at all. Maybe implement the same algorithm as networkx (with code here), which is described in this paper (direct pdf link here). Another possibility is described in this arXiv paper. Here is also Johnson's original 1975 paper, Finding all the elementary circuits of a directed graph.
networkx
https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/findloop/ - especially the last algorithm, Tarjan's Bridge-finding algorithm, looks sound.
The current code does not return a minimal cycle basis at all. Maybe implement the same algorithm as
networkx
(with code here), which is described in this paper (direct pdf link here). Another possibility is described in this arXiv paper. Here is also Johnson's original 1975 paper, Finding all the elementary circuits of a directed graph.