static void TestPathMining() { IndexedGraph g = new IndexedGraph(); g.Read(@"D:\Users\v-jiahan\HORM\Data\ex3_graph.txt"); FrequentPathMining fpm = new FrequentPathMiningBreadth(); fpm.Init(g, 1000, 3, true); ShowingNames showname = new ShowingNames(@"D:\Users\v-jiahan\HORM\Data\ex3_graph"); ShowResult(fpm._resultCache, showname); }
private static void ShowResult(List <Tuple <Path, object> > ret, ShowingNames showName) { foreach (var pair in ret.OrderByDescending(e => e.Item2)) { Console.Write(pair.Item2 + "\t"); foreach (Step step in pair.Item1) { if (step.Item2 == StepType.Nlabel) { Console.Write(showName._vertexLabelNames[step.Item1] + " "); } else if (step.Item2 == StepType.Backward) { Console.Write(showName._edgeLabelNames[step.Item1] + "- "); } else { Console.Write(showName._edgeLabelNames[step.Item1] + " "); } } Console.WriteLine(); } }