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

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 閱讀(2237) 評論(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>
            午夜国产一区| 亚洲精品国产品国语在线app| 国产精品激情电影| 免费看亚洲片| 欧美激情一区二区三区| 免费人成网站在线观看欧美高清 | 一区二区91| 日韩亚洲国产欧美| 亚洲视频在线观看| 久久riav二区三区| 免费看的黄色欧美网站| 欧美承认网站| 亚洲免费成人| 久久黄色影院| 欧美激情一区| 国产精品尤物| 亚洲福利在线视频| 一区二区三区视频免费在线观看| 亚洲尤物精选| 欧美/亚洲一区| 99精品99| 久久久久久久综合| 欧美视频你懂的| 国内视频精品| 亚洲最黄网站| 久久天天躁夜夜躁狠狠躁2022 | 欧美成人国产一区二区| 亚洲精品免费观看| 欧美亚洲网站| 欧美日韩中文字幕日韩欧美| 国产午夜亚洲精品羞羞网站| 亚洲精品社区| 久久免费精品视频| av成人天堂| 美日韩精品免费| 国产嫩草影院久久久久| 激情视频一区二区| 日韩一区二区精品葵司在线| 亚洲曰本av电影| 久久久久免费| 在线亚洲一区二区| 免费在线一区二区| 黄色亚洲大片免费在线观看| 亚洲欧美成人一区二区三区| 欧美国产日韩一区二区| 亚洲欧美国产日韩天堂区| 欧美高清日韩| 影视先锋久久| 久久久久久网| 亚洲欧美一区二区原创| 欧美日韩精品一区| 亚洲精品一区二区三区在线观看| 久久频这里精品99香蕉| 亚洲欧美国产三级| 国产精品免费在线| 亚洲欧美日本日韩| 一本色道久久精品| 欧美日韩直播| 在线亚洲自拍| 亚洲精品日韩在线| 欧美激情精品久久久久久| 亚洲激情电影在线| 欧美电影免费观看| 毛片av中文字幕一区二区| 国产视频久久久久| 久久国产天堂福利天堂| 亚洲在线免费视频| 国产精品免费看久久久香蕉| 欧美亚洲综合网| 亚洲欧美日韩国产中文在线| 国产精品色网| 久久久xxx| 久久综合一区二区三区| 精品动漫3d一区二区三区免费 | 亚洲精品极品| 欧美精选在线| 亚洲色无码播放| 亚洲一区欧美激情| 国产三级欧美三级| 免费成人av| 欧美日韩a区| 性做久久久久久免费观看欧美 | 久久久久免费| 亚洲国产视频直播| 亚洲精品欧美一区二区三区| 亚洲毛片网站| 亚洲手机成人高清视频| 国产偷国产偷精品高清尤物| 久久免费黄色| 欧美精品123区| 欧美一区二区精美| 可以看av的网站久久看| 中文国产一区| 久久精品国产一区二区电影 | 欧美紧缚bdsm在线视频| 中文国产亚洲喷潮| 久久国产一区二区| 91久久精品国产91性色| 亚洲精品一区二区三区不| 国产精品二区在线观看| 老色鬼久久亚洲一区二区| 母乳一区在线观看| 欧美一区二区视频在线| 久久婷婷人人澡人人喊人人爽| 一本综合精品| 久久久精品一区| 午夜精品久久久久99热蜜桃导演| 久久天堂国产精品| 欧美伊人久久久久久久久影院 | 欧美14一18处毛片| 午夜精品视频一区| 欧美精品三级日韩久久| 久久先锋资源| 欧美成人午夜免费视在线看片| 亚洲一区久久久| 欧美成人伊人久久综合网| 久久精品成人一区二区三区蜜臀| 欧美激情精品久久久| 久久久综合精品| 国产精品美女黄网| 亚洲麻豆视频| 亚洲人成在线播放| 性8sex亚洲区入口| 亚洲一区二区在线| 欧美成人免费播放| 欧美电影在线观看完整版| 国产视频在线观看一区二区| 中日韩男男gay无套| 亚洲国产精品一区制服丝袜| 翔田千里一区二区| 欧美一区二区三区在线播放| 欧美肉体xxxx裸体137大胆| 美女视频黄免费的久久| 国产精品永久免费在线| 亚洲视频在线播放| 亚洲制服欧美中文字幕中文字幕| 免费一级欧美片在线播放| 久久久噜噜噜久噜久久| 国内精品视频在线播放| 午夜精品久久久久99热蜜桃导演| 亚洲欧美日本国产专区一区| 欧美激情网站在线观看| 亚洲国产精品欧美一二99| 亚洲激情一区二区| 欧美精品久久一区二区| 亚洲免费久久| 亚洲综合成人在线| 国产精品亚洲人在线观看| 在线视频精品一区| 亚洲欧美日韩精品在线| 国产欧美精品国产国产专区| 欧美一级理论片| 亚洲一区二区三区在线视频| 国产精品夫妻自拍| 欧美一区二区三区视频在线观看 | 国产视频久久| 久久精品夜色噜噜亚洲a∨| 国产精品伊人日日| 久久久久久久尹人综合网亚洲| 久久亚洲影院| 在线国产日韩| 欧美高清视频一区二区三区在线观看| 欧美电影在线观看完整版| 一区二区精品国产| 国产精品久久中文| 久久av一区二区| 亚洲电影免费在线| 亚洲午夜精品17c| 欧美日韩久久| 在线亚洲成人| 欧美成人免费全部| 亚洲欧美激情四射在线日| 国产午夜精品在线| 欧美日韩亚洲国产一区| 亚洲网址在线| 亚洲第一二三四五区| 日韩网站免费观看| 国产日韩欧美三级| 欧美日韩国产美女| 欧美一级免费视频| 亚洲精品国产视频| 久久综合网色—综合色88| 亚洲欧洲日产国码二区| 国产日韩欧美在线看| 欧美成人免费一级人片100| 日韩视频免费在线| 久久精品理论片| 亚洲一区二区视频在线| 亚洲二区在线观看| 国产精品久久中文| 欧美日韩精品免费| 久久五月天婷婷| 亚洲一区二区网站| 亚洲精品久久久久久久久久久久| 久久精品中文| 亚洲欧美日韩国产一区二区| 伊人久久大香线蕉综合热线 | 午夜精品美女自拍福到在线| 亚洲精品男同| 亚洲国产精品一区二区久|