diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-02-27 13:04:43 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-02-27 13:04:43 +0100 |
| commit | e09410a14cee2ac5a6e415a4fc8233edcecdf82f (patch) | |
| tree | b016e7854feecdd3821c43bf05711c7f387b4e33 /graph/graph.tex | |
| parent | 101ca1a295a47c6ab7a89129873f5ad5bd3c49f4 (diff) | |
add binary lifting and make old LCA optional
Diffstat (limited to 'graph/graph.tex')
| -rw-r--r-- | graph/graph.tex | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/graph/graph.tex b/graph/graph.tex index 6fbdb74..b251278 100644 --- a/graph/graph.tex +++ b/graph/graph.tex @@ -15,7 +15,7 @@ \end{itemize} \end{algorithm} -\begin{algorithm}{Lowest Common Ancestor} +\begin{algorithm}[optional]{Lowest Common Ancestor} \begin{methods} \method{init}{baut DFS-Baum über $g$ auf}{\abs{V}\*\log(\abs{V})} \method{getLCA}{findet LCA}{1} @@ -24,6 +24,16 @@ \sourcecode{graph/LCA_sparse.cpp} \end{algorithm} +\begin{algorithm}{Binary Lifting} + \begin{methods} + \method{Lift}{constructor}{\abs{V}} + \method{depth}{distance to root of vertex $v$}{1} + \method{lift}{vertex above $v$ at depth $d$}{\log(\abs{V})} + \method{lca}{lowest common ancestor of $u$ and $v$}{\log(\abs{V})} + \end{methods} + \sourcecode{graph/binary_lifting.cpp} +\end{algorithm} + \begin{algorithm}{Centroids} \begin{methods} \method{find\_centroid}{findet alle Centroids des Baums (maximal 2)}{\abs{V}} |
