public Graph(In in) throws InvalidEdgeException, SelfLoopExistsException,
			ParallelEdgeExistsException
	{
		this(in.readInt());
		// int E = in.readInt();
		in.readLine();// Number of edges will be incremented through addEdge

		while (in.hasNextLine())
		{
			String vertices[] = in.readLine().split(" ");
			int v = Integer.parseInt(vertices[0]);
			for (int i = 1; i < vertices.length; i++)
				addEdge(v, Integer.parseInt(vertices[i]));
		}
	}