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

The Way of C++

  C++博客 :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
  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 閱讀(2229) 評論(2)  編輯 收藏 引用 所屬分類: DataStruct And Algorithm

Feedback

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

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

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            久久视频一区| 国产精品五区| 亚洲精品资源| 亚洲精品欧美日韩专区| 欧美黑人在线播放| 亚洲精品网站在线播放gif| 亚洲美女一区| 亚洲欧美视频在线观看视频| 亚洲在线电影| 久久一二三四| 国产精品国产a| 亚洲国产高清一区| 久久综合伊人77777| 欧美jizz19性欧美| 一区二区三区精品视频在线观看| 亚洲国产精品一区| 亚洲欧美中文日韩v在线观看| 亚洲欧美中文日韩在线| 欧美成人免费全部| 狠狠操狠狠色综合网| 一区二区三区精品国产| 裸体一区二区| 久久国产综合精品| 欧美性事免费在线观看| 亚洲肉体裸体xxxx137| 久久午夜电影| 午夜精品一区二区三区在线| 欧美日韩在线观看一区二区| 亚洲日本中文字幕免费在线不卡| 欧美在线一二三| 亚洲一区二区三区精品在线| 欧美日韩国产一级片| 亚洲免费电影在线观看| 亚洲国产日韩欧美在线动漫| 久久午夜色播影院免费高清| 国产一区二区三区丝袜| 欧美资源在线| 老司机免费视频久久| 在线观看日韩av电影| 欧美不卡高清| 欧美激情综合在线| 亚洲午夜视频在线观看| 亚洲免费在线观看视频| 国产日韩久久| 亚洲国产欧美一区二区三区久久| 欧美激情二区三区| 国产精品久久毛片a| 新67194成人永久网站| 欧美一区精品| 亚洲日产国产精品| 亚洲网站啪啪| 99在线|亚洲一区二区| 午夜精品在线| 99在线精品观看| 午夜一级在线看亚洲| av成人免费| 麻豆av福利av久久av| 亚洲欧美另类在线| 你懂的国产精品永久在线| 亚洲主播在线| 欧美精品xxxxbbbb| 欧美刺激性大交免费视频| 欧美视频中文字幕| 99精品福利视频| 亚洲精品视频在线播放| 噜噜噜在线观看免费视频日韩| 亚洲欧美成人| 欧美视频三区在线播放| 亚洲人成在线免费观看| 亚洲品质自拍| 欧美经典一区二区三区| 亚洲国产视频直播| 中文网丁香综合网| 国产精品av久久久久久麻豆网| 亚洲精品免费观看| 亚洲永久免费精品| 国产日韩欧美一区二区三区在线观看| 亚洲最黄网站| 久久精品视频在线免费观看| 一区二区三区在线视频观看| 久久亚洲精品一区| 亚洲欧洲一区| 性色av一区二区三区在线观看| 宅男噜噜噜66国产日韩在线观看| 99精品国产在热久久婷婷| 欧美色图麻豆| 久久中文久久字幕| 中文网丁香综合网| 蜜桃久久av| 欧美一区二区三区免费在线看| 在线电影一区| 国产农村妇女精品| 欧美日本一道本在线视频| 亚洲裸体俱乐部裸体舞表演av| 欧美一区高清| 欧美一区二区高清| 一区二区三区欧美在线| 永久免费视频成人| 国产精品高精视频免费| 美乳少妇欧美精品| 久久躁日日躁aaaaxxxx| 在线亚洲一区二区| 亚洲美女在线视频| 亚洲国产精品一区二区久| 久久噜噜亚洲综合| 欧美伊人影院| 久久精品国产77777蜜臀| 亚洲一区二区三区午夜| 亚洲午夜电影在线观看| 日韩视频在线观看一区二区| 亚洲人成欧美中文字幕| 亚洲精品影院| 99www免费人成精品| 99ri日韩精品视频| 正在播放亚洲| 亚洲欧美综合国产精品一区| 亚洲欧美日韩综合一区| 久久福利影视| 欧美黄在线观看| 一区二区三区产品免费精品久久75 | 免费日韩av片| 欧美激情一级片一区二区| 欧美激情a∨在线视频播放| 欧美成人一区二区三区在线观看| 另类春色校园亚洲| 亚洲精品欧美专区| 久久本道综合色狠狠五月| 久久只有精品| 国产欧美高清| 亚洲天堂男人| 麻豆av福利av久久av| 一区二区三区av| 麻豆成人91精品二区三区| 欧美日韩精品一区二区在线播放 | 国产免费成人在线视频| 激情成人在线视频| 亚洲一区二区在线看| 欧美成人有码| 欧美在线视频全部完| 欧美日韩高清不卡| 亚洲欧洲一区二区天堂久久| 久久国产精品亚洲77777| 日韩一级精品| 欧美激情 亚洲a∨综合| 亚洲电影天堂av| 久久久一区二区三区| 欧美有码在线观看视频| 国产日韩亚洲| 久久免费国产| 亚洲韩国精品一区| 六月婷婷久久| 欧美a级在线| 国产精品免费一区二区三区在线观看 | 欧美激情视频网站| 久久久亚洲国产美女国产盗摄| 国产亚洲毛片在线| 美女啪啪无遮挡免费久久网站| 久久电影一区| 亚洲欧洲午夜| 亚洲视频图片小说| 狠狠v欧美v日韩v亚洲ⅴ| 欧美激情一区二区三级高清视频| 欧美激情影音先锋| 久久久精品网| 欧美日韩综合另类| 蜜臀a∨国产成人精品| 欧美精品一区二区三区很污很色的| 亚洲在线视频网站| 在线视频你懂得一区| 亚洲精品国产日韩| 欧美福利小视频| 亚洲成色777777女色窝| 国内精品免费在线观看| 亚洲一级特黄| 亚洲专区一区| 欧美人体xx| 亚洲人成人77777线观看| 亚洲激情自拍| 欧美理论电影网| 夜久久久久久| 亚洲小视频在线观看| 国产精品第十页| 亚洲欧美日韩国产综合精品二区| 一本色道久久综合精品竹菊| 欧美~级网站不卡| 91久久国产自产拍夜夜嗨| 在线天堂一区av电影| 国产精品一区二区久久久久| 久久久www成人免费毛片麻豆| 在线精品视频免费观看| 亚洲经典三级| 亚洲理论在线观看| 久久国产精品久久久久久久久久| 亚洲激情在线视频| 激情小说另类小说亚洲欧美| 国产精品福利在线观看| 巨胸喷奶水www久久久免费动漫| 亚洲人人精品| 免费看av成人| 欧美一区国产在线|