最小费用最大流
先说一下我个人的理解,首先以费用为权的有向图寻求最短路,在这条最短路上运送最大的货物,即尽可能大的流,当一条边的流已经等于其最大容量时,这条边就相当于没有了,此时只剩下反向流,然后重复这步操作,每次寻找费用最短路,在这条最短路上寻找最大流,当找不到最短路时,即找到最小费用最大流。
When FJ’s friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1…N, the first of which contains his house and the Nth of which contains the big barn. A total M (1 <= M <= 10000) paths that connect the fields in various ways. Each path connects two different fields and has a nonzero length smaller than 35,000.
To show off his farm in the best way, he walks a tour that starts at his house, potentially travels through some fields, and ends at the barn. Later, he returns (potentially through some fields) back to his house again.
He wants his tour to be as short as possible, however he doesn’t want to walk on any given path more than once. Calculat