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

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>
            久久在线免费| 久久精品国产精品亚洲精品| 亚洲欧美综合| 一区二区三区毛片| 夜夜嗨av一区二区三区网页| 亚洲三级网站| 在线亚洲免费视频| 亚洲欧美一区二区三区极速播放 | 亚洲黄网站黄| 欧美~级网站不卡| 亚洲福利专区| 日韩写真视频在线观看| 亚洲一区不卡| 久久福利资源站| 美女脱光内衣内裤视频久久网站| 欧美成人首页| 国产精品日韩一区| 狠狠干狠狠久久| 亚洲免费av片| 香蕉精品999视频一区二区| 久久一区精品| 99成人免费视频| 久久精品免费| 欧美国产亚洲视频| 国产麻豆午夜三级精品| 亚洲国产婷婷香蕉久久久久久| 日韩午夜电影av| 久久精品一区二区三区不卡牛牛| 欧美电影免费观看| 亚洲私人影吧| 欧美高清视频一区| 国产欧美一区二区精品性色| 日韩午夜剧场| 免费成年人欧美视频| 亚洲一级黄色| 欧美日本国产| 在线看片日韩| 久久久久久久久岛国免费| 中国女人久久久| 欧美国产三区| 亚洲国产一成人久久精品| 91久久精品国产91久久性色| 欧美偷拍另类| 亚洲福利在线观看| 欧美综合第一页| 宅男噜噜噜66国产日韩在线观看| 老司机成人网| 在线日韩av片| 久久在线91| 欧美一区二区免费| 国产精品人成在线观看免费| 亚洲午夜av电影| 亚洲黄一区二区| 久久婷婷国产综合精品青草| 国产一区二区三区四区hd| 日韩亚洲一区二区| 欧美成人资源| 欧美黄色一级视频| 亚洲乱码国产乱码精品精天堂| 另类激情亚洲| 久久婷婷久久一区二区三区| 黄色精品一二区| 麻豆精品视频在线观看| 久久精品日韩| 伊人精品久久久久7777| 蜜臀av在线播放一区二区三区| 亚洲欧美中文另类| 国产日韩综合一区二区性色av| 欧美一区二区三区视频免费播放| 亚洲在线免费观看| 国产美女诱惑一区二区| 久久久久久一区| 久久久国产一区二区| 影音先锋久久久| 欧美黑人在线播放| 免费久久99精品国产自| 日韩写真视频在线观看| 亚洲激情视频在线| 欧美日韩一区二区在线观看视频 | 欧美主播一区二区三区美女 久久精品人 | 欧美午夜精品一区| 亚洲欧美激情四射在线日| 这里只有精品在线播放| 国产欧美一区二区精品仙草咪| 久久久久国产精品一区二区| 久久黄色影院| 日韩视频一区二区三区在线播放免费观看| 亚洲三级影院| 国产欧美韩日| 亚洲电影中文字幕| 国产精品视频一区二区高潮| 老妇喷水一区二区三区| 欧美日韩视频在线一区二区观看视频 | 欧美亚洲一区在线| 久久久国产精品亚洲一区| 亚洲久久在线| 亚洲综合精品自拍| 亚洲国产精品成人va在线观看| 99v久久综合狠狠综合久久| 国产一区二区三区的电影 | 久久精品人人做人人爽| 日韩午夜激情av| 久久高清免费观看| 在线亚洲自拍| 美女爽到呻吟久久久久| 性做久久久久久久久| 免费亚洲一区二区| 久久精品网址| 国产精品www网站| 亚洲激情在线视频| 精品成人在线视频| 亚洲自拍三区| 一本在线高清不卡dvd| 久久久91精品国产一区二区三区 | 久久精品国产一区二区三| 美女国产一区| 久久本道综合色狠狠五月| 欧美日韩视频一区二区| 欧美韩日一区二区| 狠狠爱综合网| 校园激情久久| 亚洲欧美韩国| 欧美日韩日日骚| 亚洲国内精品在线| 影音先锋亚洲精品| 久久疯狂做爰流白浆xx| 久久精品国产久精国产爱| 国产精品不卡在线| 一区二区动漫| 99re热这里只有精品免费视频| 麻豆国产精品一区二区三区| 久久综合中文色婷婷| 国产日韩一区在线| 欧美亚洲色图校园春色| 欧美在线观看www| 国产精品乱码一区二三区小蝌蚪 | 日韩视频国产视频| 一本大道久久a久久综合婷婷| 久久综合导航| 欧美大学生性色视频| 亚洲国产成人在线视频| 免费成年人欧美视频| 亚洲夫妻自拍| 久久国产日本精品| 国产日产欧美一区| 午夜精品剧场| 久久久久久久久岛国免费| 狠狠色狠狠色综合人人| 亚洲一级片在线观看| 国产精品九九| 欧美一级视频免费在线观看| 久久激情视频免费观看| 国产字幕视频一区二区| 久久久在线视频| 亚洲激情自拍| 亚洲一区在线视频| 国产伦精品一区二区三区| 欧美亚洲综合久久| 欧美 日韩 国产 一区| 91久久久精品| 欧美日韩成人激情| 亚洲欧美日韩系列| 老鸭窝毛片一区二区三区| 亚洲激情视频在线播放| 欧美大片免费观看| 99热这里只有精品8| 欧美一区二区在线观看| 在线免费日韩片| 欧美日韩一二三区| 午夜亚洲伦理| 欧美国产视频日韩| 亚洲影院污污.| 狠狠色狠狠色综合日日五| 欧美国产一区二区三区激情无套| 99精品国产在热久久下载| 久久天天躁夜夜躁狠狠躁2022 | 夜夜夜久久久| 久久综合久久久| 亚洲精品一级| 国产亚洲欧美另类中文| 欧美高清视频在线| 欧美有码在线视频| 亚洲国产精选| 久久精品国产99国产精品澳门| 91久久久久久久久久久久久| 国产精品一区二区久久精品 | 欧美国产国产综合| 午夜在线精品偷拍| 99国产精品99久久久久久粉嫩| 久久久999国产| 亚洲女同在线| 一区二区三区久久久| 136国产福利精品导航| 国产精品久久二区二区| 欧美成人一区二区三区在线观看 | 亚洲精品久久| 欧美成年视频| 免费成人高清| 久久影院午夜论| 久久久久久久欧美精品|