\section{lib/neatogen/dijkstra.c File Reference}
\label{dijkstra_8c}\index{lib/neatogen/dijkstra.\-c@{lib/neatogen/dijkstra.\-c}}
{\ttfamily \#include \char`\"{}bfs.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}dijkstra.\-h\char`\"{}}\\*
{\ttfamily \#include $<$limits.\-h$>$}\\*
{\ttfamily \#include $<$stdlib.\-h$>$}\\*
Include dependency graph for dijkstra.\-c\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dijkstra_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf heap}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf M\-A\-X\-\_\-\-D\-I\-S\-T}~(double){\bf I\-N\-T\-\_\-\-M\-A\-X}
\item 
\#define {\bf L\-O\-O\-P}~{\bf while}({\bf T\-R\-U\-E})
\item 
\#define {\bf left}(i)~(2$\ast$(i))
\item 
\#define {\bf right}(i)~(2$\ast$(i)+1)
\item 
\#define {\bf parent}(i)~((i)/2)
\item 
\#define {\bf inside\-Heap}(h, i)~((i)$<$h-\/$>$heap\-Size)
\item 
\#define {\bf greater\-Priority}(h, i, j, {\bf dist})~({\bf dist}[h-\/$>${\bf data}[i]]$<${\bf dist}[h-\/$>${\bf data}[j]])
\item 
\#define {\bf assign}(h, i, j, index)~\{h-\/$>${\bf data}[i]=h-\/$>${\bf data}[j]; index[h-\/$>${\bf data}[i]]=i;\}
\item 
\#define {\bf exchange}(h, i, j, index)
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef {\bf Dist\-Type} {\bf Word}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf dijkstra} ({\bf int} {\bf vertex}, {\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n, {\bf Dist\-Type} $\ast${\bf dist})
\item 
{\bf int} {\bf dijkstra\-\_\-bounded} ({\bf int} {\bf vertex}, {\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n, {\bf Dist\-Type} $\ast${\bf dist}, {\bf int} bound, {\bf int} $\ast$visited\-\_\-nodes)
\item 
void {\bf dijkstra\-\_\-f} ({\bf int} {\bf vertex}, {\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n, float $\ast${\bf dist})
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\index{dijkstra.\-c@{dijkstra.\-c}!assign@{assign}}
\index{assign@{assign}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{assign}]{\setlength{\rightskip}{0pt plus 5cm}\#define assign(
\begin{DoxyParamCaption}
\item[{}]{h, }
\item[{}]{i, }
\item[{}]{j, }
\item[{}]{index}
\end{DoxyParamCaption}
)~\{h-\/$>${\bf data}[i]=h-\/$>${\bf data}[j]; index[h-\/$>${\bf data}[i]]=i;\}}\label{dijkstra_8c_a8fcfb45ba30af0259a7e9d31f36598c9}


Definition at line 45 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!exchange@{exchange}}
\index{exchange@{exchange}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{exchange}]{\setlength{\rightskip}{0pt plus 5cm}\#define exchange(
\begin{DoxyParamCaption}
\item[{}]{h, }
\item[{}]{i, }
\item[{}]{j, }
\item[{}]{index}
\end{DoxyParamCaption}
)}\label{dijkstra_8c_a03369df4e4fec63d0fde6f43976da834}
{\bfseries Value\-:}
\begin{DoxyCode}
\{\textcolor{keywordtype}{int} temp; \(\backslash\)
                temp=h->data[i]; \(\backslash\)
                h->data[i]=h->data[j]; \(\backslash\)
                h->data[j]=temp; \(\backslash\)
                index[h->data[i]]=i; \(\backslash\)
                index[h->data[j]]=j; \(\backslash\)
\}
\end{DoxyCode}


Definition at line 46 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!greater\-Priority@{greater\-Priority}}
\index{greater\-Priority@{greater\-Priority}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{greater\-Priority}]{\setlength{\rightskip}{0pt plus 5cm}\#define greater\-Priority(
\begin{DoxyParamCaption}
\item[{}]{h, }
\item[{}]{i, }
\item[{}]{j, }
\item[{}]{{\bf dist}}
\end{DoxyParamCaption}
)~({\bf dist}[h-\/$>${\bf data}[i]]$<${\bf dist}[h-\/$>${\bf data}[j]])}\label{dijkstra_8c_aea04f0aa5c4ef477deacde7ef84b6e71}


Definition at line 44 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!inside\-Heap@{inside\-Heap}}
\index{inside\-Heap@{inside\-Heap}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{inside\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}\#define inside\-Heap(
\begin{DoxyParamCaption}
\item[{}]{h, }
\item[{}]{i}
\end{DoxyParamCaption}
)~((i)$<$h-\/$>$heap\-Size)}\label{dijkstra_8c_adda52696a85f2fcd786c3c012ced5415}


Definition at line 43 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!left@{left}}
\index{left@{left}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{left}]{\setlength{\rightskip}{0pt plus 5cm}\#define left(
\begin{DoxyParamCaption}
\item[{}]{i}
\end{DoxyParamCaption}
)~(2$\ast$(i))}\label{dijkstra_8c_a88f812bfe1d7a86c0c2992626aa4b73d}


Definition at line 40 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!L\-O\-O\-P@{L\-O\-O\-P}}
\index{L\-O\-O\-P@{L\-O\-O\-P}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{L\-O\-O\-P}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\-O\-O\-P~{\bf while}({\bf T\-R\-U\-E})}\label{dijkstra_8c_a8e8f11caf539de9555d07b4e7ef5b1da}


Definition at line 34 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!M\-A\-X\-\_\-\-D\-I\-S\-T@{M\-A\-X\-\_\-\-D\-I\-S\-T}}
\index{M\-A\-X\-\_\-\-D\-I\-S\-T@{M\-A\-X\-\_\-\-D\-I\-S\-T}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{M\-A\-X\-\_\-\-D\-I\-S\-T}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\-A\-X\-\_\-\-D\-I\-S\-T~(double){\bf I\-N\-T\-\_\-\-M\-A\-X}}\label{dijkstra_8c_ae4f6058c45a018de2c45bc43f0c405ae}


Definition at line 30 of file dijkstra.\-c.



Referenced by dijkstra(), and dijkstra\-\_\-bounded().

\index{dijkstra.\-c@{dijkstra.\-c}!parent@{parent}}
\index{parent@{parent}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{parent}]{\setlength{\rightskip}{0pt plus 5cm}\#define parent(
\begin{DoxyParamCaption}
\item[{}]{i}
\end{DoxyParamCaption}
)~((i)/2)}\label{dijkstra_8c_a915a9564b15f2c25e828da2e9a05769c}


Definition at line 42 of file dijkstra.\-c.

\index{dijkstra.\-c@{dijkstra.\-c}!right@{right}}
\index{right@{right}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{right}]{\setlength{\rightskip}{0pt plus 5cm}\#define right(
\begin{DoxyParamCaption}
\item[{}]{i}
\end{DoxyParamCaption}
)~(2$\ast$(i)+1)}\label{dijkstra_8c_aa5fbf3b618e0f76fb19954b173e3cfd7}


Definition at line 41 of file dijkstra.\-c.



\subsection{Typedef Documentation}
\index{dijkstra.\-c@{dijkstra.\-c}!Word@{Word}}
\index{Word@{Word}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{Word}]{\setlength{\rightskip}{0pt plus 5cm}typedef {\bf Dist\-Type} {\bf Word}}\label{dijkstra_8c_a0b1204fffbdb53aa75a982c975a248d0}


Definition at line 32 of file dijkstra.\-c.



\subsection{Function Documentation}
\index{dijkstra.\-c@{dijkstra.\-c}!dijkstra@{dijkstra}}
\index{dijkstra@{dijkstra}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{dijkstra}]{\setlength{\rightskip}{0pt plus 5cm}void dijkstra (
\begin{DoxyParamCaption}
\item[{{\bf int}}]{vertex, }
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n, }
\item[{{\bf Dist\-Type} $\ast$}]{dist}
\end{DoxyParamCaption}
)}\label{dijkstra_8c_af704e9408b8962ee2750e6ca37d987d6}


Definition at line 155 of file dijkstra.\-c.



References vtx\-\_\-data\-::edges, vtx\-\_\-data\-::ewgts, I\-N\-T\-\_\-\-M\-A\-X, M\-A\-X\-\_\-\-D\-I\-S\-T, and vtx\-\_\-data\-::nedges.



Referenced by embed\-\_\-graph().

\index{dijkstra.\-c@{dijkstra.\-c}!dijkstra\-\_\-bounded@{dijkstra\-\_\-bounded}}
\index{dijkstra\-\_\-bounded@{dijkstra\-\_\-bounded}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{dijkstra\-\_\-bounded}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} dijkstra\-\_\-bounded (
\begin{DoxyParamCaption}
\item[{{\bf int}}]{vertex, }
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n, }
\item[{{\bf Dist\-Type} $\ast$}]{dist, }
\item[{{\bf int}}]{bound, }
\item[{{\bf int} $\ast$}]{visited\-\_\-nodes}
\end{DoxyParamCaption}
)}\label{dijkstra_8c_a38116e0396ec33b0e368fcd32344d073}


Definition at line 200 of file dijkstra.\-c.



References bfs\-\_\-bounded(), vtx\-\_\-data\-::edges, vtx\-\_\-data\-::ewgts, F\-A\-L\-S\-E, free\-Queue(), M\-A\-X\-\_\-\-D\-I\-S\-T, mk\-Queue(), vtx\-\_\-data\-::nedges, N\-U\-L\-L, and T\-R\-U\-E.

\index{dijkstra.\-c@{dijkstra.\-c}!dijkstra\-\_\-f@{dijkstra\-\_\-f}}
\index{dijkstra\-\_\-f@{dijkstra\-\_\-f}!dijkstra.c@{dijkstra.\-c}}
\subsubsection[{dijkstra\-\_\-f}]{\setlength{\rightskip}{0pt plus 5cm}void dijkstra\-\_\-f (
\begin{DoxyParamCaption}
\item[{{\bf int}}]{vertex, }
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n, }
\item[{float $\ast$}]{dist}
\end{DoxyParamCaption}
)}\label{dijkstra_8c_a81785a7638251cc3ca2461acadf1845e}


Definition at line 360 of file dijkstra.\-c.



References vtx\-\_\-data\-::edges, M\-A\-X\-F\-L\-O\-A\-T, N\-\_\-\-G\-N\-E\-W, and vtx\-\_\-data\-::nedges.

