POJ 2195 Going Home home: There is an equal amount of people and houses on the map of N * M, moving one space per person to spend 1. Seeking the minimum cost? 3.5 With the water problem-solving network flow minimum cost flow is still very conventional minimum cost flow, the new source s, s to establish a cap from everyone = 1, cost = 0 edge; new meeting point t, from each house establishing cap = 1, cost = 0 to T edge; establish appropriate fee from each person, cap = the minimum cost flow to each side to a room, and F = the number of the run, such as for the first example: 2 FIG 2 .m H. construction: #include <iostream> ...
Continue reading : yard farm >> POJ 2195 problem solution Going Home "Challenge Programming Contest"
Original link : http://www.hankcs.com/program/algorithm/poj-2195-going-home.html
Reproduced in: https: //my.oschina.net/hankcs/blog/375492