/// <summary> /// テスト用メインメソッド /// </summary> public static void Main(string[] args) { AdjacencyList graph = GRPReader.ReadGraph(Common.INSTANCE_PATH + @"tree_sample.grp"); int[] result = GraphScanning.CalcBreadth(graph, 0); Console.WriteLine("===result==="); foreach (int node in result) { Console.Write(node + ","); } Console.WriteLine(); }
/// <summary> /// テスト用メインメソッド /// </summary> public static void Main(string[] args) { AdjacencyList graph = GRPReader.ReadGraph(Common.INSTANCE_PATH + @"scc_sample2.grp"); if (!graph.IsDirected) { Common.ErrorExit("StronglyConnectedComponentアルゴリズムは、有向辺グラフにのみ適用できます"); } int[] cluster_array = Calc((DirectedAdjacencyList)graph); foreach (int node in cluster_array) { Console.WriteLine(node); } }
public static void Main(string[] args) { AdjacencyList graph = GRPReader.ReadGraph(Common.INSTANCE_PATH + @"eulerian_sample3.grp"); if (!JudgeEulerian(graph)) { Common.ErrorExit("インスタンスはオイラーグラフである必要があります。"); } int[] result = Calc(graph); Console.WriteLine("===result==="); foreach (int node in result) { Console.Write(node + ","); } Console.WriteLine(); }