Mehr Doku zu Erreichbarkeit von Knoten
This commit is contained in:
parent
fa9ca8a340
commit
5eb7dd85ac
1 changed files with 32 additions and 1 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
\documentclass{article}
|
\documentclass{article}
|
||||||
|
|
||||||
|
\usepackage{amsmath}
|
||||||
|
\usepackage{algorithm}
|
||||||
|
\usepackage[noend]{algpseudocode}
|
||||||
|
|
||||||
|
\makeatletter
|
||||||
|
\def\BState{\State\hskip-\ALG@thistlm}
|
||||||
|
\makeatother
|
||||||
|
|
||||||
\title{FOP Projektgruppe 175}
|
\title{FOP Projektgruppe 175}
|
||||||
\author{Steffen Wagner\\
|
\author{Steffen Wagner\\
|
||||||
Dennis Weinberger\\
|
Dennis Weinberger\\
|
||||||
|
|
@ -22,6 +30,29 @@
|
||||||
Der Algorithmus, der prüft, ob alle Knoten erreichbar sind, ist
|
Der Algorithmus, der prüft, ob alle Knoten erreichbar sind, ist
|
||||||
folgender:
|
folgender:
|
||||||
|
|
||||||
tbc
|
\begin{algorithm}
|
||||||
|
\caption{Erreichbarkeit aller Knoten}\label{euclid}
|
||||||
|
\begin{algorithmic}[1]
|
||||||
|
\Procedure{allNodesConnected}{}
|
||||||
|
\State $\textit{firstNode} \gets \text{first element of }\textit{nodes}$
|
||||||
|
\State $allVisitedNodes \gets \textit{empty}$
|
||||||
|
\State $nextVisitNodes \gets empty$
|
||||||
|
\State $\text{append } firstNode \text{ to } allVisitedNodes$
|
||||||
|
\State $\text{neighborsOf } firstNode$
|
||||||
|
\State $\rightarrow \text{filter out all } x \text{ where } allVisitedNodes \text{ contains } x$
|
||||||
|
\State $\rightarrow \text{append to } nextVisitNodes$
|
||||||
|
\BState \emph{loop}
|
||||||
|
\If {$nextVisitNodes \text{ is empty}$}
|
||||||
|
break
|
||||||
|
\EndIf
|
||||||
|
\State $\text{neighborsOf first element of } nextVisitNodes$
|
||||||
|
\State $\rightarrow \text{filter out all } x \text{ where } allVisitedNodes \text{ contains } x$
|
||||||
|
\State $\rightarrow \text{append to } nextVisitNodes$
|
||||||
|
\State $\text{append first element of } nextVisitNodes \text{ to } allVisitedNodes$
|
||||||
|
\State $\text{delete first element of } nextVisitNodes$
|
||||||
|
\BState \emph{end loop}
|
||||||
|
\EndProcedure
|
||||||
|
\end{algorithmic}
|
||||||
|
\end{algorithm}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue