POJ 2112 Optimal Milking problem solution "Challenge Programming Contest"

POJ 2112 Optimal Milking problem solution "Challenge Programming Contest"
POJ 2112 Optimal Milking Harvest Moon: K milking machines distributed among the C cows, each up to serve both M cow. Given distance matrix, seeking to minimize the largest cattle away? 3.5 by means of water flow network problem bipartite graph matching saw minimize the maximum (or minimum maximized), of course, it is a binary search. First shortest path between two points out pretreatment can simply get warshall_floyd. Then build a network flow, the lead edge of a capacity of 1 from s to cattle, edge from the milking machine to t primers a capacity of M, then the maximum path-half the bipartite graph matching built FIG when cows to the inter milking machine the distance is greater than the limit edge ignored. Binary determination condition that the flow rate is the maximum flow ...

Continue reading : yard farm >> POJ 2112 Optimal Milking problem solution "Challenge Programming Contest"

Original link : http://www.hankcs.com/program/algorithm/poj-2112-optimal-milking-manager.html

Reproduced in: https: //my.oschina.net/hankcs/blog/368735

Guess you like

Origin blog.csdn.net/weixin_34189116/article/details/91780104