Graphs: Adjacency List Notation
For this unweighted and undirected graph, the adjacency list notation
we will use to represent it looks like this:
|
B C |
|
A C
D |
|
A B D E |
|
B C E |
|
C D |
Each vertex in the graph is placed in a box in the left hand column.
Each adjacent vertex is shown as a node in the list to its right.
The arrows indicate the next node in the list.
The order of vertices does not matter. They are shown here
alphabetically just for clarity.
For a weighted graph, we add the weight to each node, like this:
|
(B,8) (C,5) |
|
(A,8) (C,4)
(D,11) |
|
(A,5) (B,4)
(D,6) (E,7) |
|
(B,11) (C,6)
(E,7) |
|
(C,7) (D,7) |