public BellmanFordSP(EdgeWeightedDigraph G, int s)
	{
		vertex = new Vertex[G.V()];
		queue = new LinkedList<Vertex>();
		subProblemSize = 0;

		for (int i = 0; i < G.V(); i++)
			vertex[i] = new Vertex(i, Double.POSITIVE_INFINITY);

		vertex[s].distTo = 0.0;
		queue.addFirst(vertex[s]);
		vertex[s].onQ = true;
		subProblemSize = 1;
		while (!queue.isEmpty() && !this.hasNegativeCycle())
		{
			Vertex v = queue.removeLast();
			v.onQ = false;
			relax(G, v);
			if (subProblemSize == G.V())
				findNegativeCycle(G);
			subProblemSize++;
		}
	}