Esempio n. 1
0
        public GraphStuff.Graph Do()
        {
            KeyValuePair <GraphStuff.Graph, GraphStuff.Graph> vp = graph.PrepareGraphForMatching();

            GraphStuff.Graph tree     = vp.Key;
            GraphStuff.Graph prepared = vp.Value;

            GraphStuff.Graph matched = prepared.MinimalMatching();
            GraphStuff.Graph merged  = tree.MergeWithMatching(matched.Edges);

            EulerPath     eulerAlg  = new EulerPath(merged);
            Queue <Edge>  eulerPath = eulerAlg.FindEuler();
            CutToHamilton cutAlg    = new CutToHamilton(eulerPath, graph);


            return(cutAlg.Cut());
        }