-2

In a directed graph, what the algorithm can find out all cycles that contain a specific vertex v?

象嘉道
  • 3,657
  • 5
  • 33
  • 49

1 Answers1

1

Tarjan's algorithm for strongly connected components will give you the SCC, to which that specific vertex belongs. Now you can run a backtracking algorithm on the SCC to find all the simple cycles, which start and end on v.

chill
  • 16,470
  • 2
  • 40
  • 44