
二分图匹配
文章平均质量分 78
在路上-小武
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
二分图匹配匈牙利算法
本文转自http://imlazy.ycool.com/post.1603708.html什么是二分图,什么是二分图的最大匹配,这些定义我就不讲了,网上随便都找得到。二分图的最大匹配有两种求法,第一种是最大流(我在此假设读者已有网络流的知识);第二种就是我现在要讲的匈牙利算法。这个算法说白了就是最大流的算法,但是它跟据二分图匹配这个问题的特点,把最大流算法做了简化,提高了效率。匈牙利算法其实很转载 2012-07-19 16:09:37 · 394 阅读 · 0 评论 -
hdu 2063(二分图匹配匈牙利)
#include#includeconst int max=510;int map[max][max];int flag[max],mat[max],k,n,m;int find(int i){ for(int j=1;j<=m;j++) if(!flag[j]&&map[i][j]) { flag[j]=1; if(mat[j]==-1||find(m原创 2012-07-19 17:12:16 · 391 阅读 · 0 评论 -
hdu Machine Schedule 1150 二分图匹配
以后多看多做英文题,看不懂也要看!最小的启动次数 ,意思就是用最少得点覆盖所有的边最小顶点覆盖=最大二分匹配数#include#include const int NV = 1505;const int NE = 10000; struct MaxMatch { int n, size; int head[NV]; int aug[NV];原创 2012-07-20 18:19:13 · 341 阅读 · 0 评论 -
nyoj 月老的难题
邻接矩阵超时,只能用邻接表,注意范围#include#includeconst int nv=1001;const int ne=10001;struct maxmatch{ int n,size; int head[nv]; int mark[nv]; int aug[nv]; struct edge { int v,w,next; edge(){} ed原创 2012-07-20 08:18:14 · 335 阅读 · 0 评论