Path: A connected list of vertices

Graph Data Structures

Graph $G=(V,E)$ | $V=\{v_1, \dots, v_n\}$ | $n=|V|,m=|E|$

Adjacency Matrix

Complexity

$$ \begin{matrix}
& a & b & c & d & e \\ \hline a |& 0 & 1 & 1 & 0 & 0 \\ b |& 0 & 0 & 0 & 1 & 1 \\ c |& 0 & 0 & 0 & 0 & 0 \\ d |& 0 & 0 & 0 & 0 & 0\\ e |& 0 & 0 & 0 & 0 & 0\\ \end{matrix} $$

Adjacency List (Sparse Matrix)

Complexity