public static void calculate(Graph g, int r)
        {
            /* init vertices list. */
            for (int i = 0; i < g.n_v; i++)
            {
                g.v[i].key = float.MaxValue;
               // g.v[i].distance2D = float.MaxValue;
                g.v[i].parent = -1;
            }
            /* Set root. */
            g.v[r].key = 0;
            /* Prepare queue of type min. */
            //FibonacciHeap q = new FibonacciHeap(g);
            NaiveProrityQueue q = new NaiveProrityQueue(g);

            /* Until queue is empty. */
            while (!q.isQueueEmpty())
            {
                FibonacciNode u = q.extractMin();
                Console.Write("" + u.key);
                g.v[u.index].inQ = false;

                LinkedListNode tmp = g.adj.getVertex(u.index).root;
                while (tmp != null)
                {
                    if (g.v[tmp.index].inQ && g.wageFunction(u.index, tmp.index) < g.v[tmp.index].key)
                    {
                        g.v[tmp.index].parent = u.index;
                        q.decreaseKey(g.v[tmp.index], g.wageFunction(u.index, tmp.index), g.wage2D(u.index, tmp.index));
                    }
                    tmp = tmp.next;
                }
            }
        }
 public NaiveProrityQueue(Graph g) 
 {
     foreach(FibonacciNode v in g.v) {
         v.inQ = true;
         list.Add(v);
 }
 }
        public static Result calculate(VRPParser benchmark, float cutOffTime)
        {
            int num_depots = benchmark.Num_Depots;
            List<int> nextDay = new List<int>();

            /* Convert benchmark into points. */
            List<Point> points = new List<Point>();
            for (int j = 0; j < benchmark.Num_Locations; j++)
            {
                int time;
                if (j - 1 < 0) time = 0;
                else time = benchmark.Time_Avail[j - 1];
                
                points.Add(new Point(benchmark.Location_Coord[j][0],benchmark.Location_Coord[j][1], time));
            }

            /* Get rid of the points which are appearing after cut off */
            List<Point> tmp = new List<Point>();
            for (int i = 0; i < points.Count; i++ )
            {
                if (points[i].Z < cutOffTime)
                {
                    tmp.Add(points[i]);

                }
                else nextDay.Add(i); 
            }
            points = tmp;
           

            /* Convert points into a graph. */
            Graph graph = new Graph(points.Count);
            for (int i = 0; i < points.Count; i++)
            {
                for (int j = i + 1; j < points.Count; j++)
                {
                    graph.addEdge(i, j, euclidDistance(points[i], points[j]), distance2D(points[i], points[j]));
                }
            }
            PrimAlgorithm.calculate(graph, 0);
            int[] route = preorderWalk(graph, 0);
            Result result = new Result(route, nieUmiemCSharpaWiecJestTaZmienna, nextDay);

            return result;
        }
     /**
      * Based on passed graph, heap is created.
      *
      * @param g Graph to be stored in Fibonacci heap.
      */
     public FibonacciHeap(Graph g) {
     foreach(FibonacciNode v in g.v) {
         v.inQ = true;
         insert(v);
     }
 }
        private static void traverse(Graph graph, FibonacciNode node, List<int> route, int index)
        {
            route.Add(node.index);
            nieUmiemCSharpaWiecJestTaZmienna += node.distance2D;
            for (int i = 0; i < graph.v.Length; i++)
            {
                if (graph.v[i].parent == node.index) traverse(graph, graph.v[i], route, ++index);
            }

        }
 private static int[] preorderWalk(Graph graph, int root)
 {
     nieUmiemCSharpaWiecJestTaZmienna = 0;
     List<int> route = new List<int>();
     traverse(graph, graph.v[root], route, 0);
     route.Add(root);
     return route.ToArray();
 }