Graphs: Adjacency List Notation



For this unweighted and undirected graph, the adjacency list notation we will use to represent it looks like this:

 A
 B C
 B
 A C   D
 C
 A B D E
 D
 B C E
 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:

 A
 (B,8) (C,5)
 B
 (A,8) (C,4)   (D,11)
 C
 (A,5) (B,4) (D,6) (E,7)
 D
 (B,11) (C,6) (E,7)
 E
 (C,7) (D,7)