private int V;// number of vertices in the graph

        public MstPrimEager(int GraphNodesCount)
        {
            V       = GraphNodesCount;
            edgeTo  = new Edge[V];
            distTo  = new double[V];
            visited = new bool[V];
            ipq     = new IPriorityQueue(V);
            for (int i = 0; i < V; ++i)
            {
                distTo[i] = double.MaxValue;
            }
        }
Ejemplo n.º 2
0
 public EagerPrimMST(int GraphNodesCount)
 {
     NumOfVertices = GraphNodesCount;
     Nodes         = new int[ImageUtilities.DistinctColours.Count];
     Edge_To       = new Edge[NumOfVertices];
     Destination   = new double[NumOfVertices];
     Visited       = new bool[NumOfVertices];
     IndexedPQ     = new IPriorityQueue(NumOfVertices);
     for (int i = 0; i < NumOfVertices; ++i)
     {
         Destination[i] = double.MaxValue;
     }
 }