Tested a little bit of performance. ConnectedGraph and Graph do about the same time except Graph can handle more components much better. However, I need to optimize ConnectedGraph.areIsomorphic as it has somehow slowed down...
Commiting minor change because stash failed.
Performance issue is in the BFS method not my main algorithm.
Converted using Map<Integer, Interger> to arrays so I can compare performance.