Skip to content

Commit cd971a7

Browse files
alemini18adamant-pwn
authored andcommitted
fix tabulation
1 parent cdcf398 commit cd971a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/graph/hungarian-algorithm.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ From this follow these **key ideas** that allow us to achieve the required compl
158158

159159
- To quickly recalculate the potential (faster than the $\mathcal{O}(n^2)$ naive version), you need to maintain auxiliary minima for each of the columns:
160160

161-
<br><div style="text-align:center">$minv[j]=\min_{i\in Z_1} A[i][j]-u[i]-v[j].$</div><br>
161+
<br><div style="text-align:center">$minv[j]=\min_{i\in Z_1} A[i][j]-u[i]-v[j].$</div><br>
162162

163-
It's easy to see that the desired value $\Delta$ is expressed in terms of them as follows:
163+
It's easy to see that the desired value $\Delta$ is expressed in terms of them as follows:
164164

165-
<br><div style="text-align:center">$\Delta=\min_{j\notin Z_2} minv[j].$</div><br>
165+
<br><div style="text-align:center">$\Delta=\min_{j\notin Z_2} minv[j].$</div><br>
166166

167-
Thus, finding $\Delta$ can now be done in $\mathcal{O}(n)$.
167+
Thus, finding $\Delta$ can now be done in $\mathcal{O}(n)$.
168168

169-
It is necessary to update the array $minv$ when new visited rows appear. This can be done in $\mathcal{O}(n)$ for the added row (which adds up over all rows to $\mathcal{O}(n^2)$). It is also necessary to update the array $minv$ when recalculating the potential, which is also done in time $\mathcal{O}(n)$ ($minv$ changes only for columns that have not yet been reached: namely, it decreases by $\Delta$).
169+
It is necessary to update the array $minv$ when new visited rows appear. This can be done in $\mathcal{O}(n)$ for the added row (which adds up over all rows to $\mathcal{O}(n^2)$). It is also necessary to update the array $minv$ when recalculating the potential, which is also done in time $\mathcal{O}(n)$ ($minv$ changes only for columns that have not yet been reached: namely, it decreases by $\Delta$).
170170

171171
Thus, the algorithm takes the following form: in the outer loop, we consider matrix rows one by one. Each row is processed in time $\mathcal{O}(n^2)$, since only $\mathcal{O}(n)$ potential recalculations could occur (each in time $\mathcal{O}(n)$), and the array $minv$ is maintained in time $\mathcal{O}(n^2)$; Kuhn's algorithm will work in time $\mathcal{O}(n^2)$ (since it is presented in the form of $\mathcal{O}(n)$ iterations, each of which visits a new column).
172172

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy