Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

Max Alekseyev gravatar image

Unless there is a better idea, one can iterate over all cycles in the graph as explained at https://ask.sagemath.org/question/69318/find-all-cycles-in-an-undirected-graph/ and keep track what vertices are visited by cycles of what length.