@SuppressWarnings("unchecked")
	public EdgeWeightedDigraph(In in)
	{
		this.V = in.readInt();
		int E = in.readInt();

		adj = (List<WeightedDirectedEdge>[]) new LinkedList[V];
		for (int v = 0; v < V; v++)
			adj[v] = new LinkedList<WeightedDirectedEdge>();

		for (int i = 0; i < E; i++)
		{
			int from = in.readInt();
			int to = in.readInt();
			double weight = in.readDouble();
			adj[from].add(new WeightedDirectedEdge(from, to, weight));
		}

	}