/// <summary>For testing only.</summary> public static void Main(string[] args) { IList pathList = new ArrayList(); TransducerGraph graph = CreateRandomGraph(1000, 10, 0.0, 10, pathList); System.Console.Out.WriteLine("Done creating random graph"); PrintPathOutputs(pathList, graph, true); System.Console.Out.WriteLine("Depth first search from start node"); StringBuilder b = new StringBuilder(); graph.DepthFirstSearch(true, b); System.Console.Out.WriteLine(b.ToString()); b = new StringBuilder(); System.Console.Out.WriteLine("Depth first search back from end node"); graph.DepthFirstSearch(false, b); System.Console.Out.WriteLine(b.ToString()); }
public static void Main(string[] args) { TransducerGraph.IGraphProcessor qd = new QuasiDeterminizer(); IList pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.CreateRandomGraph(1000, 10, 1.0, 10, pathList); StringBuilder b = new StringBuilder(); graph.DepthFirstSearch(true, b); System.Console.Out.WriteLine(b.ToString()); System.Console.Out.WriteLine("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.ProcessGraph(graph); System.Console.Out.WriteLine("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.TestGraphPaths(graph, newGraph, 1000); }