青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

The Way of C++

  C++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
  55 Posts :: 0 Stories :: 19 Comments :: 0 Trackbacks

公告

The first time i use this blog, i will write something that i learn which i think is worth write down.

常用鏈接

留言簿(3)

我參與的團隊

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

   Bipartite graph is the graph which include two sets(name X,and Y) and every edge in the graph has the rule that one point is in X,the other is in  Y. The mostly problem is finding the Maximum Bipartite Matching, which mean find the maximum edges in the case of keeping  the points of the edges only connecting to one edge. The other problem is the perfect matching, which means that all the vector of the graph is included in the match edges. And the solution to find the minimum number of vectors ( either in X and Y) making every edge connecting to these vectors is called the minimum coverage . Usually, we have the equation that " minimum coverage number = maximum bipartite matching". There is another problem called maximum independent set problem. This problem request to find the maximum number of M(the number of vector) which there are no edges connect to in the graph that contain N vectors. This problem can be transformed into the maximum bipartite matching problem if the conditions can be satisfied. And we have the result that " the maximum independent set vector number M= N- Maximum bipartite matching number ".
   One way to solve the maximum bipartite matching problem is the method which is called Hungary Algorithm. There are many problems in the POJ which can be solved by Hungary Algorithm as long as it's a maximum tipartite mathcing or can be transformed into.  As an example ,you can view the problem discription in the link  . The following is my code. (link:  http://acm.pku.edu.cn/JudgeOnline/problem?id=1325)
    Plz forgive my poor written English, but everyone improve it by making mistake and attempting ,right? -_-

 1
 2#include<stdio.h>
 3#include<string.h>
 4#include<iostream>
 5using namespace std;
 6const int MAX= 110;
 7int u,v,k;//u:the left node number,v:the right node number
 8bool c[MAX][MAX];//c[i][j] indicate that i of left connect to the j of right, begin with 0
 9
10int um[MAX],vm[MAX];//um[i] indicate the j of the right that connect to i, they are matched . so is vm[j]
11bool s[MAX];//s[j] check whether j of the right has been used in one round of finding the path
12
13bool Find(int u){
14    int j;
15    for(j=1;j<v;j++){
16        if(c[u][j]&&!s[j]){
17            s[j]=true;
18            if(!vm[j]||Find(vm[j])){
19                um[u]=j;
20                vm[j]=u;
21                return true;
22            }
23        }
24    }
25    return false;
26}
27                
28
29int Match(){
30    memset(um,0,sizeof(um));
31    memset(vm,0,sizeof(vm));
32    int ret=0;
33    int i;
34    for(i=1;i<u;i++)
35        if(!um[i]){
36            memset(s,false,sizeof(s));
37            if(Find(i))
38                ret++;
39        }
40    
41    return ret;
42}
43
44
45int main(){
46    
47    while(scanf("%d%d%d",&u,&v,&k)&&u){
48        memset(c,0,sizeof(c));
49        int i,a,b,d;
50        for(i=0;i<k;i++){
51            scanf("%d%d%d",&a,&b,&d);
52            if(b&&d)
53                c[b][d]=1;
54        }
55        printf("%d\n",Match());
56    }
57    return 1;
58}


   

posted on 2007-12-21 14:53 koson 閱讀(2239) 評論(2)  編輯 收藏 引用 所屬分類: DataStruct And Algorithm

Feedback

# re: Maximum Bipartite Matching 2007-12-21 18:22 winsty
好標準的匈牙利
贊一個!  回復  更多評論
  

# re: Maximum Bipartite Matching 2007-12-22 11:51 在線軟件
不錯..
但是我不是很懂啊  回復  更多評論
  


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲人成精品久久久久| 欧美精品一区二区在线观看| 亚洲精品在线看| 久久国产66| 午夜久久久久| 欧美色大人视频| 亚洲第一区在线观看| 国产在线精品自拍| 亚洲少妇最新在线视频| 亚洲精品一区二区三区av| 久久久91精品国产| 欧美专区亚洲专区| 国产精品中文字幕欧美| 99精品视频免费观看视频| 亚洲伦理网站| 欧美精品国产一区二区| 欧美激情综合| 91久久久在线| 欧美成人精品福利| 亚洲成人在线网站| 亚洲毛片在线| 欧美激情免费在线| 亚洲激情网站免费观看| 亚洲精品久久久久久下一站| 美女免费视频一区| 亚洲国产一区二区三区青草影视| 在线观看成人一级片| 久久躁日日躁aaaaxxxx| 欧美凹凸一区二区三区视频| 亚洲盗摄视频| 免费一级欧美片在线播放| 亚洲国产精品久久人人爱蜜臀 | 夜色激情一区二区| 欧美国产成人精品| 亚洲美女网站| 亚洲欧美日韩电影| 国产精品自在在线| 久久精品国产免费| 欧美国产先锋| 亚洲婷婷免费| 国产欧美亚洲视频| 久久综合国产精品台湾中文娱乐网| 嫩草影视亚洲| 中日韩美女免费视频网址在线观看 | 国产欧美精品日韩精品| 久久久久久久一区二区三区| 欧美激情精品久久久六区热门| 日韩图片一区| 国产精品一区二区女厕厕| 久久九九免费视频| 亚洲激情影视| 先锋影院在线亚洲| 黄色成人av| 免费不卡在线观看| 亚洲国产人成综合网站| 日韩午夜免费视频| 欧美午夜一区二区| 亚洲欧美综合| 久久久久一区| 91久久精品美女高潮| 欧美成人精品高清在线播放| 亚洲精品欧美精品| 99在线|亚洲一区二区| 国产精品入口尤物| 午夜在线电影亚洲一区| 免费在线视频一区| 亚洲丰满在线| 久久国产精彩视频| 亚洲欧洲一区二区天堂久久| 欧美精品日本| 亚洲在线观看| 免费不卡亚洲欧美| 一本色道88久久加勒比精品 | 欧美一区二区三区视频在线| 媚黑女一区二区| 一区二区不卡在线视频 午夜欧美不卡在 | 久久久亚洲国产天美传媒修理工| 在线播放不卡| 欧美日韩精品是欧美日韩精品| 亚洲一区三区电影在线观看| 久久人人爽人人爽| 一区二区高清视频| 国产一区二区三区久久 | 欧美高清影院| 亚洲免费网址| 尤物精品在线| 国产一区二区三区av电影| 欧美大胆a视频| 欧美一级片一区| 亚洲欧洲一级| 久久夜精品va视频免费观看| 一区二区三区欧美| 在线观看久久av| 国产精品色一区二区三区| 久久综合电影| 亚洲一区二区三区中文字幕| 一区二区三区产品免费精品久久75 | 国产一区二区高清不卡| 欧美激情在线| 久久亚洲精品中文字幕冲田杏梨 | 欧美亚洲视频在线看网址| 国产精品人人做人人爽人人添| 久久久久久一区二区| 亚洲视频一区二区| 亚洲人成在线免费观看| 美国十次了思思久久精品导航| 午夜精品久久久久久久99水蜜桃| 日韩天堂在线观看| 亚洲国产片色| 在线成人欧美| 国模精品一区二区三区| 欧美理论电影网| 麻豆精品传媒视频| 久久久久**毛片大全| 亚洲女同在线| 亚洲校园激情| 亚洲视频专区在线| 一本色道久久综合亚洲精品按摩 | 欧美精品99| 美女视频黄 久久| 久久野战av| 久久免费视频在线| 久久精品免费播放| 午夜精品久久久久久久久| 一区二区91| 一区二区三区欧美日韩| 日韩写真在线| 一本色道久久综合亚洲精品婷婷| 亚洲激情中文1区| 亚洲经典三级| 日韩午夜免费视频| 日韩一区二区福利| 亚洲最新色图| 亚洲日本成人网| 亚洲一区在线直播| 小嫩嫩精品导航| 久久精品亚洲一区二区三区浴池| 久久aⅴ国产欧美74aaa| 久久久国产精品亚洲一区 | 亚洲在线观看视频| 午夜精品久久久久久久99黑人| 亚洲午夜日本在线观看| 久久国产精品久久精品国产| 狂野欧美激情性xxxx欧美| 免费一级欧美在线大片| 欧美日韩国产精品专区| 国产精品激情av在线播放| 国产欧美一区二区三区久久| 国产一区视频在线观看免费| 在线播放亚洲| 亚洲毛片在线| 99riav国产精品| 久久综合五月天婷婷伊人| 亚洲国产精品久久久久秋霞不卡| 亚洲日本中文| 亚洲欧美视频一区二区三区| 久久久久欧美| 欧美日韩精品欧美日韩精品一 | 欧美不卡在线视频| 欧美午夜性色大片在线观看| 国产精品视频yy9099| 亚洲黄色小视频| 亚洲欧美综合精品久久成人| 久久野战av| 夜夜嗨av色综合久久久综合网| 午夜欧美电影在线观看| 欧美大片免费观看| 国产精品乱人伦中文| 在线欧美小视频| 日韩视频一区二区| 午夜视频在线观看一区二区三区| 老司机一区二区三区| 国产精品99久久久久久久久| 久久裸体艺术| 国产农村妇女毛片精品久久莱园子| 一区视频在线看| 亚洲欧美日韩视频一区| 久久综合给合| 日韩一本二本av| 久久精品一级爱片| 国产精品每日更新在线播放网址| 亚洲国产欧美一区二区三区丁香婷| 午夜欧美不卡精品aaaaa| 欧美韩日一区| 久久国内精品视频| 国产精品乱码妇女bbbb| 亚洲精品久久久久| 久久se精品一区二区| 亚洲高清在线精品| 久久免费一区| 国内一区二区三区| 欧美在线|欧美| 亚洲一区二区三区在线| 欧美日本一区| 亚洲免费av电影| 亚洲电影av在线| 久久综合五月| 亚洲福利一区| 午夜精品亚洲一区二区三区嫩草| 在线视频免费在线观看一区二区|