a slightly more flexible API
generalized the API
no effective change
now the weight graph need not contain all of the edges of the flowgraph