void Start() { EdgeGraph testgraph = new EdgeGraph(15); ProcessingUtil graphprocessing = new ProcessingUtil(); for (int i = 0; i < 20; i++) { testgraph.AddVertex(); } //TestGraph | Build graph //first connected component set of edges testgraph.AddEdge(1, 2); testgraph.AddEdge(2, 3); testgraph.AddEdge(3, 1); testgraph.AddEdge(3, 5); testgraph.AddEdge(5, 6); testgraph.AddEdge(6, 4); testgraph.AddEdge(4, 5); testgraph.AddEdge(7, 6); testgraph.AddEdge(3, 8); testgraph.AddEdge(8, 1); testgraph.AddEdge(6, 9); testgraph.AddEdge(9, 4); testgraph.AddEdge(8, 10); testgraph.AddEdge(10, 11); testgraph.AddEdge(11, 12); testgraph.AddEdge(12, 10); //second component (not connected to first) testgraph.AddEdge(15, 18); testgraph.AddEdge(18, 19); testgraph.AddEdge(17, 18); //TestGraph | Analysis int componentcount = 0; int closurecount = 0; List <HashSet <int> > components = new List <HashSet <int> >(); _graphprocessing.CountClosures(testgraph, out componentcount, out closurecount, out components); float closurerate = (float)closurecount / (float)testgraph.EdgeCount; //TestGraph | Debug Print Results Debug.Log("TestGraph | Components Count = " + componentcount); for (int i = 0; i < components.Count; i++) { HashSet <int> set = components[i]; string setstring = string.Join(",", components[i]); Debug.Log("TestGraph | ConnectedComponent# " + (i + 1) + " = " + setstring); } float[] normalizedcomponents = _graphprocessing.RemapComponentsToArray(testgraph, components); string normalizedcomponentsstring = string.Join(",", normalizedcomponents); Debug.Log("TestGraph | NormalizedComponents = " + normalizedcomponentsstring); Debug.Log("TestGraph | Closures Count = " + closurecount); Debug.Log("TestGraph | Closures Rate = " + closurerate); }