Theorem network flow summary

By tyqtyq , please click on the left if missing link thanks

DAG directed acyclic graph category

$ Minimum path covering the DAG = | G | - bipartite graph G 'maximum matching $

Minimum path defined coverage: cover all vertices of the entire diagram each time (the path may be a point) with minimal path


G ': for each point in the original $ I $ split into two points $ i_1, i_2 $, if the original edge $ (x, y) $ exists, then G' Side $ (x_1, y_2) $ presence


prove
   
   
Theorem: If a match is zero, then there is no P to the side, so there is clearly a minimum path coverage = | G | - the maximum number of matches = | G |. On the number of matches based on 0, i.e., S in a no edge, if increasing a match in S side (i1, j2), then there is an edge one of i connection j of path coverage graph G, namely i and j on said path, so the path can reduce a covering number; such side continues to increase to match each additional one, a reduced number of path coverage; until the matching edges can not continue to increase, the number of paths can no longer be reduced to cover ; however only described here to have matching side edges each corresponding to one path of a path covered in the connection point between the two; the following will describe a path between each connection overlay two vertices corresponding to the edge to edge a match. Similar to the above, the path covered in each connection between two vertices each directed edge , We can make the corresponding one in FIG matching i1 connected to the side j2, apparently do so out bipartite graph edges are matched, neither been previously matched i.e. X and Y are connected to two points, or through matching the point that was covered twice during the corresponding artwork, and path coverage contradiction. This indicates matching edge connection path in the overlay one relationship between the two sides of the vertex, then it illustrates the foregoing equation holds, i.e., an increase in S match each side, to reduce the number of path coverage 1. (cited from link above)

Code:

#define getpoint(i,X) (X == 1)?(i):(i+n) 
void dfs(int n){
    for(int i=head[n]; i; i=Next[i]){
        int v = ver[i] ; add_new(getpoint(i,1),getpoint(p,2)) ;    
        dfs(v) ;
    }
}
void work(){
    dfs(1) ;
}

Guess you like

Origin www.cnblogs.com/tyqtyq/p/WangLuoLiu.html