
数据结构之费用流
文章平均质量分 84
曉_寧
这个作者很懒,什么都没留下…
展开
-
hdu2686 Matrix 最大费用最大流
点击打开链接原创 2014-08-23 01:19:40 · 634 阅读 · 0 评论 -
poj 2159 Going Home 最小费用最大流
题意 给定一个N*M的地图,地图上有若干个man和house,且man与house的数量一致。man每移动一格需花费$1(即单位费用=单位距离),一间house只能入住一个man。现在要求所有的man都入住house,求最小费用。 man可以从house上跨过原创 2014-08-23 00:58:14 · 639 阅读 · 0 评论 -
poj 2516 Minimum Cost 最小费用最大流
大致题意: 有N个供应商,M个店主,K种物品。每个供应商对每种物品的的供应量已知,每个店主对每种物品的需求量的已知,从不同的供应商运送不同的货物到不同的店主手上需要不同的花费,又已知从供应商Mj送第kind种货物的单位数量到店主Ni手上所需的单位花费。 问:供应是否满足需求?如果满足,最小运费是多少? 解题思路: 费用流问题。 (1)原创 2014-08-23 01:04:16 · 727 阅读 · 0 评论 -
poj2135 Farm Tour 最小费用最大流
FJ带朋友参观自己的农场,从自己的房子出发到barn(谷仓、畜棚或车库),再从barn返回自己的房子,要求去回不走同一条路。 建图:取超级源点,并与房子连一条边,容量为2;取barn与超级汇点间的边的容量为2,中间的建图方法如代码。 因为此题是无向图,所以建边的时候如果建两条费用都是正的边的话,退流时无法修正费用。 所以应该建4条边: 第一对: a->b cost 1 b->a -cost原创 2014-08-23 01:06:47 · 692 阅读 · 0 评论 -
poj3422 Kaka's Matrix Travels 最大费用最大流
题意: 有个方阵,每个格子里都有一个非负数,从左上角走到右下角,每次走一步,只能往右或往下走,经过的数字拿走 每次都找可以拿到数字和最大的路径走,走k次,求最大和 这是 最大费用最大流 问题 每次spfa都找的是一条和最大的路径 s--到左上角的边流量是K限制增广次数 求最大费用最大流只需要把费用换成相反数,用最小费用最大流求解即可 构图过程:如上图 每个点拆分成两个 a a'原创 2014-08-23 01:12:43 · 729 阅读 · 0 评论 -
hdu 1853 Cyclic Tour 费用流
Description There are N cities in our country, and M one-way roads connecting them. Now Little Tom wants to make several cyclic tours, which satisfy that, each cycle contain at least two cities, an原创 2015-01-26 01:12:31 · 544 阅读 · 0 评论 -
hdu 3667 Transportation 费用流
Description There are N cities, and M directed roads connecting them. Now you want to transport K units of goods from city 1 to city N. There are many robbers on the road, so you must be very caref原创 2015-01-27 00:12:42 · 667 阅读 · 0 评论 -
hdu 3315 My Brute 网络流
Description Seaco is a beautiful girl and likes play a game called “My Brute”. Before Valentine’s Day, starvae and xingxing ask seaco if she wants to spend the Valentine’s Day with them, but seaco原创 2015-01-26 20:28:24 · 826 阅读 · 0 评论