public static void MainTest(string[] args) { string filename = args[0]; Digraph g; if (args.Length >= 2) { string delimiter = args[1]; SymbolDigraph sg = new SymbolDigraph(filename, delimiter); g = sg.G; Topological topological = new Topological(g); foreach (int v in topological.Order()) { Console.WriteLine(sg.Name(v)); } } else { g = new Digraph(new TextInput(filename)); Topological topological = new Topological(g); foreach (int v in topological.Order()) { Console.WriteLine(v); } } }
public static void MainTest(string[] args) { string filename = args[0]; string delimiter = args[1]; SymbolDigraph sg = new SymbolDigraph(filename, delimiter); Digraph G = sg.G; string t = Console.ReadLine(); while (t != null) { if (sg.Contains(t)) { foreach (int v in G.Adj(sg.Index(t))) { Console.WriteLine(" " + sg.Name(v)); } } t = Console.ReadLine(); } }