Skip to content

Commit 2b9791e

Browse files
authored
Merge pull request scanof#14 from scanof/scanof-patch-2
Add comments to dinic
2 parents 534f461 + 88ce88b commit 2b9791e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

code/flows/dinic.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Corte minimo: vertices con dist[v]>=0 (del lado de src) VS. dist[v]==-1 (del lado del dst)
2+
// Para el caso de la red de Bipartite Matching (Sean V1 y V2 los conjuntos mas proximos a src y dst respectivamente):
3+
// Reconstruir matching: para todo v1 en V1 ver las aristas a vertices de V2 con it->f>0, es arista del Matching
4+
// Min Vertex Cover: vertices de V1 con dist[v]==-1 + vertices de V2 con dist[v]>0
5+
// Max Independent Set: tomar los vertices NO tomados por el Min Vertex Cover
6+
// Max Clique: construir la red de G complemento (debe ser bipartito!) y encontrar un Max Independet Set
7+
// Min Edge Cover: tomar las aristas del matching + para todo vertices no cubierto hasta el momento, tomar cualquier arista de el
18
// Complexity O(V^2*E)
29
const ll inf = 1e18;
310
struct edge {
@@ -60,4 +67,4 @@ struct Dinic{
6067
sort(all(cut)), cut.resize(unique(all(cut)) - cut.begin());
6168
return cut;
6269
}
63-
};
70+
};

0 commit comments

Comments
 (0)