package network3; import java.util.Set; // Graph with vertices of type V. public interface WeightedGraph { // Set of vertices of the graph. public Set vertices(); // Set of neighbors of a vertex v. public Set neighbors(V v); // true if and only if v1 and v2 are neighbors. public boolean areNeighbors(V v1, V v2); // Weight of the edge between the vertices v1 and v2. // Throws an exception IllegalArgumentException if v1 and v2 are not neighbors. public double weight(V v1, V v2) throws IllegalArgumentException; }