Credit: algotree.org https://www.youtube.com/watch?v=AfSk24UTFS8 MIT OpenCourseWare, 14. DFS, Topological Sort, by Prof Erik Demaine https://www.algotree.org/algorithms/tree_graph_traversal/depth_first_search/cycle_detection_in_directed_graphs/
Cycle Detection A Graph has a cycle <--> DFS has a backward edge