二分图最大权匹配

int un,vn;//un左边点数,vn右边点数
int g[maxn][maxn];
int linker[maxn],lu[maxn],lv[maxn];
int slack[maxn];
bool visu[maxn],visv[maxn];
bool dfs( int u )
{
    visu[u] = true;
    for ( int v=0 ; vtmp )
            slack[v] = tmp;
    }
    return false;
}
int km()
{
    memset ( linker , -1 , sizeof(linker) );
    memset ( lv , 0 , sizeof(lv) );
    for ( int i=0 ; ilu[i] ) lu[i] = g[i][j];
    }
    for ( int u=0 ; uslack[i] )
                    d = slack[i];
            for ( int i=0 ; i

 

你可能感兴趣的:(图论模板)