Add a method to the graph class which computes the weight between two sets of nodes.
Add a method to the graph class which computes the weight between two sets of nodes.