@SuppressWarnings("unchecked")
	public EdgeWeightedGraph(In in)
	{
		this.V = in.readInt();
		int E = in.readInt();
		adj = (List<WeightedEdge>[]) new LinkedList[V];
		for (int v = 0; v < V; v++)
			adj[v] = new LinkedList<WeightedEdge>();
		for (int i = 0; i < E; i++)
			addEdge(new WeightedEdge(in.readInt(), in.readInt(), in.readDouble()));
	}