Determine whether a vertex lies on a cycle of given length
Given a graph G and a vertex u of G, the problem of determining whether there exists a cycle of length k starting at u is a common one in graph theory.
Mathematica provides a function Findcycle ( FindCycle[{g, v}, …]
finds a cycle that contains the vertex v.) for this task, though I am not sure which algorithm it employs—perhaps depth-first search (DFS)? Sage, on the other hand, does not appear to have a corresponding built-in function.