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
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
e.g.
connected components pseudocode
finding the number of connected components is quite time intensive