cycle checking

a graph has a cycle if, at any point in the graph:

cycle checking = checking if there is a cycle about a particular vertex

i.e., starting from a particular vertex, is there a path back to it

solution: use DFS to find a path back to starting node

connected components

answering the question: for a given graph, how many connected subgraphs are there?

solution: create a componentOf[] array, where each index refers to a vertex, and the value at that index refers to which graph it’s in

finding the number of connected components is quite time intensive