Graph encoding schemes:

Adjacency list: Below we represent a graph of 6 nodes with an adjacency list.

1       -->     2       -->     4/
2       -->     5/              
3       -->     6       -->     5/
4       -->     2/              
5       -->     4/              
6       -->     6/              

Adjacency matrix: Below we reperesent the same graph of 6 nodes with an adjacency matrix.

        1       2       3       4       5       6
1       0       1       0       1       0       0
2       0       0       0       0       1       0
3       0       0       0       0       1       1
4       0       1       0       0       0       0
5       0       0       0       1       0       0
6       0       0       0       0       0       1

RepresentingGraphs (last edited 2004-10-19 22:24:03 by yakko)