next up previous
Next: Up: Previous:

2. Adjacency matrix

Matrix A $\mid$V$\mid$ x $\mid$V$\mid$, where

\begin{displaymath}A[i,j] \;=\; \left\{ \begin{array}{ll} 1 & {\rm if} \;(i,j) \in E \\
0 & {\rm otherwise} \end{array} \right.\end{displaymath}

Memory \(\Theta(V^2)\), Lookup O(1)



\psfig{figure=figures/f16-5.ps}

Both allow added satellite data easily



\psfig{figure=figures/f16-6.ps}

Adjacency list better for sparse graphs

Graph algorithms


next up previous
Next: Up: Previous: