public static void TestGraph() { Digraph d = new Digraph(7); d.addEdge(0, 1); d.addEdge(1, 2); d.addEdge(2, 3); d.addEdge(3, 1); d.addEdge(0, 4); d.addEdge(4, 5); d.addEdge(5, 6); d.addEdge(6, 0); DirectedCycle dc = new DirectedCycle(d); var list = dc.returnCycle(); }
public static void TestGraph2() { FastChange fc = new FastChange(); for (int i = 0; i < (int)Constant.tassi.LAST_VALUE; i++) { string[] entry = ((Constant.tassi)i).ToString().Split('_'); fc.addString(entry[0]); fc.addString(entry[1]); } Digraph d = new Digraph(fc.numberOfItems); for (int i = 0; i < (int)Constant.tassi.LAST_VALUE; i++) { string[] entry = ((Constant.tassi)i).ToString().Split('_'); d.addEdge(entry[0], entry[1]); d.addEdge(entry[1], entry[0]); } }