8000 fix(gomory-hu): typos and improve style · cp-algorithms/cp-algorithms@a40adf7 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a40adf7

Browse files
committed
fix(gomory-hu): typos and improve style
1 parent 20dc3ca commit a40adf7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/graph/gomory_hu.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The gomory-hu tree of an undirected graph with capacities consists of a weighted
66

77
## Gusfield's Simplification Algorithm
88

9-
We can say that two cuts (X, Y) and (U, V) *cross* if all four set intersections $X \cap U$, $X \cap V$, $Y \cap U$, $Y \cap V$ are nonempty. Most of the work of the original gomory-hu method is involved in maintaining the noncrossing condition. The following simpler, yet efficient method, proposed by Gusfield uses crossing cuts to produce equivalent flow trees.
9+
We can say that two cuts $(X, Y)$ and $(U, V)$ *cross* if all four set intersections $X \cap U$, $X \cap V$, $Y \cap U$, $Y \cap V$ are nonempty. Most of the work of the original gomory-hu method is involved in maintaining the noncrossing condition. The following simpler, yet efficient method, proposed by Gusfield uses crossing cuts to produce equivalent flow trees.
1010

1111
## Complexity
1212

@@ -15,11 +15,11 @@ The algorithm total complexity is $\mathcal{O}(V*MaxFlow)$, wich means that the
1515
### Implementation
1616
This implementation considers the Gomory-Hu tree as a struct with methods:
1717

18-
- The maximum flow algorithm must also be a struct with methods, in the implementation bellow we utilize Dinic's algorithm to calculate the maximum flow.
18+
- The maximum flow algorithm must also be a struct with methods, in the implementation below we utilize Dinic's algorithm to calculate the maximum flow.
1919

2020
- The algorithm is 0-indexed and will root the tree in node 0.
2121

22-
- The method *solve* returns the list of edges of the Gomory-Hu tree.
22+
- The method *solve* returns a list that contains for each index $i$ the cost of the edge connecting $i$ and its parent, and the parent number.
2323

2424
```{.cpp file=gomoryhu}
2525
struct gomory_hu {

0 commit comments

Comments
 (0)
0