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());
        }
Esempio n. 2
0
 public Prim(GraphStuff.Graph inputG)
 {
     inputGraph = inputG;
 }
Esempio n. 3
0
 public Christofides(GraphStuff.Graph g)
 {
     graph = g;
 }
Esempio n. 4
0
 public DFS(GraphStuff.Graph g)
 {
     zajete = new List <Node>();
     this.g = g;
 }