\hypertarget{opal__graph_8h}{\section{opal/class/opal\+\_\+graph.h File Reference}
\label{opal__graph_8h}\index{opal/class/opal\+\_\+graph.\+h@{opal/class/opal\+\_\+graph.\+h}}
}


The opal\+\_\+graph interface is used to provide a generic graph infrastructure to Open-\/\+M\+P\+I.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+object.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+list.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+pointer\+\_\+array.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+value\+\_\+array.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t}
\begin{DoxyCompactList}\small\item\em A vertex class. \end{DoxyCompactList}\item 
struct \hyperlink{structopal__adjacency__list__t}{opal\+\_\+adjacency\+\_\+list\+\_\+t}
\begin{DoxyCompactList}\small\item\em An \hyperlink{structopal__adjacency__list__t}{opal\+\_\+adjacency\+\_\+list\+\_\+t} class. \end{DoxyCompactList}\item 
struct \hyperlink{structopal__graph__edge__t}{opal\+\_\+graph\+\_\+edge\+\_\+t}
\begin{DoxyCompactList}\small\item\em An edge class. \end{DoxyCompactList}\item 
struct \hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t}
\begin{DoxyCompactList}\small\item\em A graph class. \end{DoxyCompactList}\item 
struct \hyperlink{structvertex__distance__from__t}{vertex\+\_\+distance\+\_\+from\+\_\+t}
\begin{DoxyCompactList}\small\item\em This structure represent the distance (weight) of a vertex from some point in the graph. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{opal__graph_8h_af53fc226f7c81662b2e161657cb2dc00}{\#define {\bfseries D\+I\+S\+T\+A\+N\+C\+E\+\_\+\+I\+N\+F\+I\+N\+I\+T\+Y}~0x7fffffff}\label{opal__graph_8h_af53fc226f7c81662b2e161657cb2dc00}

\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \hyperlink{opal__graph_8h_ae410d31898a40d162f4a671ea1947fd3}{opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data} )(void $\ast$$\ast$dst, void $\ast$src)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} pointer for coping a vertex data from one vertex to another. \end{DoxyCompactList}\item 
typedef void($\ast$ \hyperlink{opal__graph_8h_a1852afdc82da5715635df504c63e425b}{opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data} )(void $\ast$vertex\+\_\+data)
\begin{DoxyCompactList}\small\item\em free vertex data. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a982873d598cc7d64e77dd1b900deeeee}{typedef void $\ast$($\ast$ \hyperlink{opal__graph_8h_a982873d598cc7d64e77dd1b900deeeee}{opal\+\_\+graph\+\_\+alloc\+\_\+vertex\+\_\+data} )(void)}\label{opal__graph_8h_a982873d598cc7d64e77dd1b900deeeee}

\begin{DoxyCompactList}\small\item\em Allocate vertex data. \end{DoxyCompactList}\item 
typedef int($\ast$ \hyperlink{opal__graph_8h_a60f309b20d1f32f5e2956d8269bda8c4}{opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data} )(void $\ast$vertex\+\_\+data1, void $\ast$vertex\+\_\+data2)
\begin{DoxyCompactList}\small\item\em Compare two vertices data. \end{DoxyCompactList}\item 
typedef char $\ast$($\ast$ \hyperlink{opal__graph_8h_a35554b6985ab191e896e3803dd667d0e}{opal\+\_\+graph\+\_\+print\+\_\+vertex} )(void $\ast$vertex\+\_\+data)
\begin{DoxyCompactList}\small\item\em print a vertex data. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a18bd9ee2c00330983f573a1d7c3a4a58}{typedef struct \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} \hyperlink{opal__graph_8h_a18bd9ee2c00330983f573a1d7c3a4a58}{opal\+\_\+graph\+\_\+vertex\+\_\+t}}\label{opal__graph_8h_a18bd9ee2c00330983f573a1d7c3a4a58}

\begin{DoxyCompactList}\small\item\em A type for vertex. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a2d7ed9efd8f50eea8c1f0e1f755e56c6}{typedef struct \\*
\hyperlink{structopal__adjacency__list__t}{opal\+\_\+adjacency\+\_\+list\+\_\+t} \hyperlink{opal__graph_8h_a2d7ed9efd8f50eea8c1f0e1f755e56c6}{opal\+\_\+adjacency\+\_\+list\+\_\+t}}\label{opal__graph_8h_a2d7ed9efd8f50eea8c1f0e1f755e56c6}

\begin{DoxyCompactList}\small\item\em A type for \hyperlink{structopal__adjacency__list__t}{opal\+\_\+adjacency\+\_\+list\+\_\+t}. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a6be4c40fa13033d178151f27afa4c456}{typedef struct \hyperlink{structopal__graph__edge__t}{opal\+\_\+graph\+\_\+edge\+\_\+t} \hyperlink{opal__graph_8h_a6be4c40fa13033d178151f27afa4c456}{opal\+\_\+graph\+\_\+edge\+\_\+t}}\label{opal__graph_8h_a6be4c40fa13033d178151f27afa4c456}

\begin{DoxyCompactList}\small\item\em A type for an edge. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a21ea9d49d37f765677997eb2b0d0f99c}{typedef struct \hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} \hyperlink{opal__graph_8h_a21ea9d49d37f765677997eb2b0d0f99c}{opal\+\_\+graph\+\_\+t}}\label{opal__graph_8h_a21ea9d49d37f765677997eb2b0d0f99c}

\begin{DoxyCompactList}\small\item\em A type for graph class. \end{DoxyCompactList}\item 
\hypertarget{opal__graph_8h_a40ba3753bf3dd1e6812448358fdb0c84}{typedef struct \\*
\hyperlink{structvertex__distance__from__t}{vertex\+\_\+distance\+\_\+from\+\_\+t} \hyperlink{opal__graph_8h_a40ba3753bf3dd1e6812448358fdb0c84}{vertex\+\_\+distance\+\_\+from\+\_\+t}}\label{opal__graph_8h_a40ba3753bf3dd1e6812448358fdb0c84}

\begin{DoxyCompactList}\small\item\em A type for vertex distance. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{opal__graph_8h_afc6e0532e7e52631668f0e7b5562f8b2}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t})}\label{opal__graph_8h_afc6e0532e7e52631668f0e7b5562f8b2}

\item 
\hypertarget{opal__graph_8h_aa46c61352e582abe0d70a7fb66ae93ad}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__graph__edge__t}{opal\+\_\+graph\+\_\+edge\+\_\+t})}\label{opal__graph_8h_aa46c61352e582abe0d70a7fb66ae93ad}

\item 
\hypertarget{opal__graph_8h_a88bbcf9868db8d3d0862a904e1f28af3}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__adjacency__list__t}{opal\+\_\+adjacency\+\_\+list\+\_\+t})}\label{opal__graph_8h_a88bbcf9868db8d3d0862a904e1f28af3}

\item 
\hypertarget{opal__graph_8h_aee48494f8842ec767f6da2590621175d}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t})}\label{opal__graph_8h_aee48494f8842ec767f6da2590621175d}

\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__graph_8h_aefa7fa8dc08d215d8a0dbd1c19306f76}{opal\+\_\+graph\+\_\+add\+\_\+vertex} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I adds a vertex to graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__graph_8h_a4e62adaaa3935a2df4ae560ce682299c}{opal\+\_\+graph\+\_\+remove\+\_\+vertex} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I remove a vertex from graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__graph_8h_a4ccf1fcb8692e0174a9b98df9cfe367d}{opal\+\_\+graph\+\_\+add\+\_\+edge} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__edge__t}{opal\+\_\+graph\+\_\+edge\+\_\+t} $\ast$edge)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I adds an edge (connection between two vertices) to a graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__graph_8h_a112d21b66efa33e77adc15af2516114a}{opal\+\_\+graph\+\_\+remove\+\_\+edge} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__edge__t}{opal\+\_\+graph\+\_\+edge\+\_\+t} $\ast$edge)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I removes an edge (a connection between two vertices) from the graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t \hyperlink{opal__graph_8h_aef3dbb1f1341408ea9242a348e99602c}{opal\+\_\+graph\+\_\+adjacent} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex1, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex2)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I tell us if two vertices are adjacent. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__graph_8h_adead48c3dbdbccc07f5006e5198366e0}{opal\+\_\+graph\+\_\+get\+\_\+order} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph)
\begin{DoxyCompactList}\small\item\em This Graph A\+P\+I returns the order of the graph (number of vertices) \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__graph_8h_acb4925d15e5235847bd7bce996752aac}{opal\+\_\+graph\+\_\+get\+\_\+size} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph)
\begin{DoxyCompactList}\small\item\em This Graph A\+P\+I returns the size of the graph (number of edges) \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$ \hyperlink{opal__graph_8h_a6bcc9dac76a2823a68177f8e1f9d1501}{opal\+\_\+graph\+\_\+find\+\_\+vertex} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, void $\ast$vertex\+\_\+data)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I finds a vertex in the graph according the vertex data. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__graph_8h_a275d50ead59978034e3972c1556a18c5}{opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__pointer__array__t}{opal\+\_\+pointer\+\_\+array\+\_\+t} $\ast$vertices\+\_\+list)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I returns an array of pointers of all the vertices in the graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__graph_8h_a4f033e40d3ea3fa369196b919a03747e}{opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex, \hyperlink{structopal__value__array__t}{opal\+\_\+value\+\_\+array\+\_\+t} $\ast$adjacent)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I returns all the adjacent of a vertex and the distance (weight) of those adjacent and the vertex. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__graph_8h_a248269b77703e79a0980cce8201acd2c}{opal\+\_\+graph\+\_\+duplicate} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$$\ast$dest, \hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$src)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I duplicates a graph. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t \hyperlink{opal__graph_8h_ab3ab55a466b01f4a7f911b745b92b343}{opal\+\_\+graph\+\_\+spf} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex1, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex2)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I finds the shortest path between two vertices. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t \hyperlink{opal__graph_8h_ac41401c6207c1ccd7dd88ae2a7ffc9fc}{opal\+\_\+graph\+\_\+dijkstra} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__graph__vertex__t}{opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$vertex, \hyperlink{structopal__value__array__t}{opal\+\_\+value\+\_\+array\+\_\+t} $\ast$distance\+\_\+array)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I returns the distance (weight) from a reference vertex to all other vertices in the graph using the Dijkstra algorithm. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__graph_8h_a3278ad0a05d9bc3da6c42642d8d69da3}{opal\+\_\+graph\+\_\+print} (\hyperlink{structopal__graph__t}{opal\+\_\+graph\+\_\+t} $\ast$graph)
\begin{DoxyCompactList}\small\item\em This graph A\+P\+I prints a graph -\/ mostly for debug uses. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The opal\+\_\+graph interface is used to provide a generic graph infrastructure to Open-\/\+M\+P\+I. 

The graph is represented as an adjacentcy list. The graph is a list of vertices. The graph is a weighted directional graph. Each vertex contains a pointer to a vertex data. This pointer can point to the structure that this vertex belongs to. 

\subsection{Typedef Documentation}
\hypertarget{opal__graph_8h_a60f309b20d1f32f5e2956d8269bda8c4}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data}}
\index{opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ opal\+\_\+graph\+\_\+compare\+\_\+vertex\+\_\+data)(void $\ast$vertex\+\_\+data1, void $\ast$vertex\+\_\+data2)}}\label{opal__graph_8h_a60f309b20d1f32f5e2956d8269bda8c4}


Compare two vertices data. 


\begin{DoxyParams}{Parameters}
{\em vertex\+\_\+data1} & \\
\hline
{\em vertex\+\_\+data2} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int The comparition results. 1-\/ vertex\+\_\+data1 is bigger then vertex\+\_\+data2, 0-\/ vertex\+\_\+data1 is equal to vertex\+\_\+data2 and -\/1-\/ vertex\+\_\+data1 is smaller the vertex\+\_\+data2. 
\end{DoxyReturn}
\hypertarget{opal__graph_8h_ae410d31898a40d162f4a671ea1947fd3}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data}}
\index{opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ opal\+\_\+graph\+\_\+copy\+\_\+vertex\+\_\+data)(void $\ast$$\ast$dst, void $\ast$src)}}\label{opal__graph_8h_ae410d31898a40d162f4a671ea1947fd3}


\hyperlink{structFunction}{Function} pointer for coping a vertex data from one vertex to another. 


\begin{DoxyParams}{Parameters}
{\em dst} & The destination pointer of vertex\+\_\+data \\
\hline
{\em src} & The source pointer of the vertex\+\_\+data \\
\hline
\end{DoxyParams}
\hypertarget{opal__graph_8h_a1852afdc82da5715635df504c63e425b}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data}}
\index{opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data@{opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ opal\+\_\+graph\+\_\+free\+\_\+vertex\+\_\+data)(void $\ast$vertex\+\_\+data)}}\label{opal__graph_8h_a1852afdc82da5715635df504c63e425b}


free vertex data. 


\begin{DoxyParams}{Parameters}
{\em vertex\+\_\+data} & The vertex data can point to the structure that this vertex belongs to. \\
\hline
\end{DoxyParams}
\hypertarget{opal__graph_8h_a35554b6985ab191e896e3803dd667d0e}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+print\+\_\+vertex@{opal\+\_\+graph\+\_\+print\+\_\+vertex}}
\index{opal\+\_\+graph\+\_\+print\+\_\+vertex@{opal\+\_\+graph\+\_\+print\+\_\+vertex}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+print\+\_\+vertex}]{\setlength{\rightskip}{0pt plus 5cm}typedef char$\ast$($\ast$ opal\+\_\+graph\+\_\+print\+\_\+vertex)(void $\ast$vertex\+\_\+data)}}\label{opal__graph_8h_a35554b6985ab191e896e3803dd667d0e}


print a vertex data. 


\begin{DoxyParams}{Parameters}
{\em vertex\+\_\+data} & \\
\hline
\end{DoxyParams}


\subsection{Function Documentation}
\hypertarget{opal__graph_8h_a4ccf1fcb8692e0174a9b98df9cfe367d}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+add\+\_\+edge@{opal\+\_\+graph\+\_\+add\+\_\+edge}}
\index{opal\+\_\+graph\+\_\+add\+\_\+edge@{opal\+\_\+graph\+\_\+add\+\_\+edge}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+add\+\_\+edge}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+graph\+\_\+add\+\_\+edge (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+edge\+\_\+t} $\ast$}]{edge}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a4ccf1fcb8692e0174a9b98df9cfe367d}


This graph A\+P\+I adds an edge (connection between two vertices) to a graph. 

The most common use for this A\+P\+I is while building a graph.


\begin{DoxyParams}{Parameters}
{\em graph} & The graph that this edge will be added to. \\
\hline
{\em edge} & The edge that we want to add.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int Success or error. this A\+P\+I can return an error if one of the vertices is not in the graph. 
\end{DoxyReturn}
find the vertices that this edge should connect.

if one of the vertices either the start or the end is not found -\/ return an error.

References opal\+\_\+list\+\_\+append, opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), and opal\+\_\+list\+\_\+get\+\_\+next.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn(), and opal\+\_\+graph\+\_\+duplicate().

\hypertarget{opal__graph_8h_aefa7fa8dc08d215d8a0dbd1c19306f76}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+add\+\_\+vertex@{opal\+\_\+graph\+\_\+add\+\_\+vertex}}
\index{opal\+\_\+graph\+\_\+add\+\_\+vertex@{opal\+\_\+graph\+\_\+add\+\_\+vertex}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+add\+\_\+vertex}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+graph\+\_\+add\+\_\+vertex (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_aefa7fa8dc08d215d8a0dbd1c19306f76}


This graph A\+P\+I adds a vertex to graph. 

The most common use for this A\+P\+I is while building a graph.


\begin{DoxyParams}{Parameters}
{\em graph} & The graph that the vertex will be added to. \\
\hline
{\em vertex} & The vertex we want to add. \\
\hline
\end{DoxyParams}
Find if this vertex already exists in the graph.

References opal\+\_\+list\+\_\+append, opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), and opal\+\_\+list\+\_\+get\+\_\+next.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn(), and opal\+\_\+graph\+\_\+duplicate().

\hypertarget{opal__graph_8h_aef3dbb1f1341408ea9242a348e99602c}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+adjacent@{opal\+\_\+graph\+\_\+adjacent}}
\index{opal\+\_\+graph\+\_\+adjacent@{opal\+\_\+graph\+\_\+adjacent}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+adjacent}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t opal\+\_\+graph\+\_\+adjacent (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex1, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex2}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_aef3dbb1f1341408ea9242a348e99602c}


This graph A\+P\+I tell us if two vertices are adjacent. 


\begin{DoxyParams}{Parameters}
{\em graph} & The graph that the vertices belongs to. \\
\hline
{\em vertex1} & first vertex. \\
\hline
{\em vertex2} & second vertex.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
uint32\+\_\+t the weight of the connection between the two vertices or infinity if the vertices are not connected. 
\end{DoxyReturn}
Verify that the first vertex belongs to the graph.

Verify that the second vertex belongs to the graph.

If the first vertex and the second vertex are the same vertex, the distance between the is 0.

find the second vertex in the adjacency list of the first vertex.

References opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), opal\+\_\+list\+\_\+get\+\_\+next, and O\+P\+A\+L\+\_\+\+O\+U\+T\+P\+U\+T.



Referenced by opal\+\_\+graph\+\_\+dijkstra().

\hypertarget{opal__graph_8h_ac41401c6207c1ccd7dd88ae2a7ffc9fc}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+dijkstra@{opal\+\_\+graph\+\_\+dijkstra}}
\index{opal\+\_\+graph\+\_\+dijkstra@{opal\+\_\+graph\+\_\+dijkstra}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+dijkstra}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t opal\+\_\+graph\+\_\+dijkstra (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex, }
\item[{{\bf opal\+\_\+value\+\_\+array\+\_\+t} $\ast$}]{distance\+\_\+array}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_ac41401c6207c1ccd7dd88ae2a7ffc9fc}


This graph A\+P\+I returns the distance (weight) from a reference vertex to all other vertices in the graph using the Dijkstra algorithm. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em vertex} & The reference vertex. \\
\hline
{\em distance\+\_\+array} & An array of vertices and their distance from the reference vertex.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
uint32\+\_\+t the size of the distance array 
\end{DoxyReturn}
Verify that the reference vertex belongs to the graph.

assign an infinity distance to all the vertices in the queue except the reference vertex which its distance should be 0.

if the distance from the first vertex in the queue to the I vertex in the queue plus the distance of the first vertex in the queue from the referenced vertex is smaller than the distance of the I vertex from the referenced vertex, assign the lower distance to the I vertex.

References opal\+\_\+graph\+\_\+adjacent(), opal\+\_\+graph\+\_\+get\+\_\+order(), opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), opal\+\_\+list\+\_\+get\+\_\+next, and O\+P\+A\+L\+\_\+\+O\+U\+T\+P\+U\+T.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn(), and opal\+\_\+graph\+\_\+spf().

\hypertarget{opal__graph_8h_a248269b77703e79a0980cce8201acd2c}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+duplicate@{opal\+\_\+graph\+\_\+duplicate}}
\index{opal\+\_\+graph\+\_\+duplicate@{opal\+\_\+graph\+\_\+duplicate}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+duplicate}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+graph\+\_\+duplicate (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$$\ast$}]{dest, }
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{src}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a248269b77703e79a0980cce8201acd2c}


This graph A\+P\+I duplicates a graph. 

Note that this A\+P\+I does not copy the graph but builds a new graph while coping just the vertices data.


\begin{DoxyParams}{Parameters}
{\em dest} & The new created graph. \\
\hline
{\em src} & The graph we want to duplicate.\\
\hline
\end{DoxyParams}
Note that this A\+P\+I does not copy the graph but builds a new graph while coping just the vertex data.


\begin{DoxyParams}{Parameters}
{\em dest} & The new created graph. \\
\hline
{\em src} & The graph we want to duplicate. \\
\hline
\end{DoxyParams}
Now, copy all the edges from the source graph

References opal\+\_\+graph\+\_\+add\+\_\+edge(), opal\+\_\+graph\+\_\+add\+\_\+vertex(), opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), and opal\+\_\+list\+\_\+get\+\_\+next.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn().

\hypertarget{opal__graph_8h_a6bcc9dac76a2823a68177f8e1f9d1501}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+find\+\_\+vertex@{opal\+\_\+graph\+\_\+find\+\_\+vertex}}
\index{opal\+\_\+graph\+\_\+find\+\_\+vertex@{opal\+\_\+graph\+\_\+find\+\_\+vertex}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+find\+\_\+vertex}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bf opal\+\_\+graph\+\_\+vertex\+\_\+t}$\ast$ opal\+\_\+graph\+\_\+find\+\_\+vertex (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{void $\ast$}]{vertex\+\_\+data}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a6bcc9dac76a2823a68177f8e1f9d1501}


This graph A\+P\+I finds a vertex in the graph according the vertex data. 


\begin{DoxyParams}{Parameters}
{\em graph} & the graph we searching in. \\
\hline
{\em vertex\+\_\+data} & the vertex data we are searching according to.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
opal\+\_\+graph\+\_\+vertex\+\_\+t$\ast$ The vertex founded or N\+U\+L\+L. 
\end{DoxyReturn}
Run on all the vertices of the graph

References opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), and opal\+\_\+list\+\_\+get\+\_\+next.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn().

\hypertarget{opal__graph_8h_a4f033e40d3ea3fa369196b919a03747e}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices@{opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices}}
\index{opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices@{opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+graph\+\_\+get\+\_\+adjacent\+\_\+vertices (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex, }
\item[{{\bf opal\+\_\+value\+\_\+array\+\_\+t} $\ast$}]{adjacents}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a4f033e40d3ea3fa369196b919a03747e}


This graph A\+P\+I returns all the adjacent of a vertex and the distance (weight) of those adjacent and the vertex. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em vertex} & The reference vertex \\
\hline
{\em adjacent} & An allocated pointer array of vertices and their distance from the reference vertex. Note that this pointer should be free after usage by the user\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int the number of adjacent in the list.
\end{DoxyReturn}
This graph A\+P\+I returns all the adjacent of a vertex and the distance (weight) of those adjacent and the vertex.


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em vertex} & The reference vertex \\
\hline
{\em adjacents} & An allocated pointer array of vertices and their distance from the reference vertex. Note that this pointer should be free after usage by the user\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int the number of adjacents in the list. 
\end{DoxyReturn}
Verify that the vertex belongs to the graph.

find the adjacency list that this vertex belongs to

References opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), opal\+\_\+list\+\_\+get\+\_\+next, opal\+\_\+list\+\_\+get\+\_\+size(), and O\+P\+A\+L\+\_\+\+O\+U\+T\+P\+U\+T.

\hypertarget{opal__graph_8h_a275d50ead59978034e3972c1556a18c5}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices@{opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices}}
\index{opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices@{opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+pointer\+\_\+array\+\_\+t} $\ast$}]{vertices\+\_\+list}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a275d50ead59978034e3972c1556a18c5}


This graph A\+P\+I returns an array of pointers of all the vertices in the graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em vertices\+\_\+list} & an array of pointers of all the vertices in the graph vertices.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int returning the graph order (the number of vertices in the returned array) 
\end{DoxyReturn}
If the graph order is 0, return N\+U\+L\+L.

References opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), opal\+\_\+list\+\_\+get\+\_\+next, and opal\+\_\+pointer\+\_\+array\+\_\+add().



Referenced by opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn(), and opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn().

\hypertarget{opal__graph_8h_adead48c3dbdbccc07f5006e5198366e0}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+get\+\_\+order@{opal\+\_\+graph\+\_\+get\+\_\+order}}
\index{opal\+\_\+graph\+\_\+get\+\_\+order@{opal\+\_\+graph\+\_\+get\+\_\+order}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+get\+\_\+order}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+graph\+\_\+get\+\_\+order (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_adead48c3dbdbccc07f5006e5198366e0}


This Graph A\+P\+I returns the order of the graph (number of vertices) 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int 
\end{DoxyReturn}


Referenced by opal\+\_\+graph\+\_\+dijkstra().

\hypertarget{opal__graph_8h_acb4925d15e5235847bd7bce996752aac}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+get\+\_\+size@{opal\+\_\+graph\+\_\+get\+\_\+size}}
\index{opal\+\_\+graph\+\_\+get\+\_\+size@{opal\+\_\+graph\+\_\+get\+\_\+size}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+get\+\_\+size}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+graph\+\_\+get\+\_\+size (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_acb4925d15e5235847bd7bce996752aac}


This Graph A\+P\+I returns the size of the graph (number of edges) 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int 
\end{DoxyReturn}
\hypertarget{opal__graph_8h_a3278ad0a05d9bc3da6c42642d8d69da3}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+print@{opal\+\_\+graph\+\_\+print}}
\index{opal\+\_\+graph\+\_\+print@{opal\+\_\+graph\+\_\+print}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+print}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+graph\+\_\+print (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a3278ad0a05d9bc3da6c42642d8d69da3}


This graph A\+P\+I prints a graph -\/ mostly for debug uses. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
\end{DoxyParams}


References opal\+\_\+list\+\_\+get\+\_\+end(), opal\+\_\+list\+\_\+get\+\_\+first(), opal\+\_\+list\+\_\+get\+\_\+next, and opal\+\_\+output().

\hypertarget{opal__graph_8h_a112d21b66efa33e77adc15af2516114a}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+remove\+\_\+edge@{opal\+\_\+graph\+\_\+remove\+\_\+edge}}
\index{opal\+\_\+graph\+\_\+remove\+\_\+edge@{opal\+\_\+graph\+\_\+remove\+\_\+edge}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+remove\+\_\+edge}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+graph\+\_\+remove\+\_\+edge (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+edge\+\_\+t} $\ast$}]{edge}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a112d21b66efa33e77adc15af2516114a}


This graph A\+P\+I removes an edge (a connection between two vertices) from the graph. 

The most common use of this A\+P\+I is while destructing a graph or while removing vertices from a graph. while removing vertices from a graph, we should also remove the connections from and to the vertices that we are removing.


\begin{DoxyParams}{Parameters}
{\em graph} & The graph that this edge will be remove from. \\
\hline
{\em edge} & the edge that we want to remove. \\
\hline
\end{DoxyParams}


References opal\+\_\+list\+\_\+remove\+\_\+item().

\hypertarget{opal__graph_8h_a4e62adaaa3935a2df4ae560ce682299c}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+remove\+\_\+vertex@{opal\+\_\+graph\+\_\+remove\+\_\+vertex}}
\index{opal\+\_\+graph\+\_\+remove\+\_\+vertex@{opal\+\_\+graph\+\_\+remove\+\_\+vertex}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+remove\+\_\+vertex}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+graph\+\_\+remove\+\_\+vertex (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_a4e62adaaa3935a2df4ae560ce682299c}


This graph A\+P\+I remove a vertex from graph. 

The most common use for this A\+P\+I is while distracting a graph or while removing relevant vertices from a graph.


\begin{DoxyParams}{Parameters}
{\em graph} & The graph that the vertex will be remove from. \\
\hline
{\em vertex} & The vertex we want to remove. \\
\hline
\end{DoxyParams}
remove all the edges of this vertex and destruct them.

remove the adjscency list of this vertex from the graph and destruct it.

delete all the edges that connected {\itshape to} the vertex.

References O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+list\+\_\+is\+\_\+empty(), opal\+\_\+list\+\_\+remove\+\_\+first(), and opal\+\_\+list\+\_\+remove\+\_\+item().



Referenced by opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn().

\hypertarget{opal__graph_8h_ab3ab55a466b01f4a7f911b745b92b343}{\index{opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}!opal\+\_\+graph\+\_\+spf@{opal\+\_\+graph\+\_\+spf}}
\index{opal\+\_\+graph\+\_\+spf@{opal\+\_\+graph\+\_\+spf}!opal\+\_\+graph.\+h@{opal\+\_\+graph.\+h}}
\subsubsection[{opal\+\_\+graph\+\_\+spf}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C uint32\+\_\+t opal\+\_\+graph\+\_\+spf (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex1, }
\item[{{\bf opal\+\_\+graph\+\_\+vertex\+\_\+t} $\ast$}]{vertex2}
\end{DoxyParamCaption}
)}}\label{opal__graph_8h_ab3ab55a466b01f4a7f911b745b92b343}


This graph A\+P\+I finds the shortest path between two vertices. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em vertex1} & The start vertex. \\
\hline
{\em vertex2} & The end vertex.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
uint32\+\_\+t the distance between the two vertices. 
\end{DoxyReturn}
Verify that the first vertex belongs to the graph.

Verify that the second vertex belongs to the graph.

Run Dijkstra algorithm on the graph from the start vertex.

find the end vertex in the distance array that Dijkstra algorithm returned.

References O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+graph\+\_\+dijkstra(), and O\+P\+A\+L\+\_\+\+O\+U\+T\+P\+U\+T.



Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn().

