Section 5.1, part B: Graphs and their representations

Abstract:

We take a look at planer graphs (in particular at Euler's formula), and computer representations of graphs (adjacency matrices, adjacency lists).

Planer Graphs

A planer graph is one which can be drawn in two-dimensions so that its arcs intersect only in nodes.

To do: Practice #10, p. 341.

To do: Practice #12, p. 342.

Euler's Formula for simple, connected planer graphs states that

displaymath133

where n is the number of nodes, a is the number of arcs, and r is the number of regions (including the infinite region surrounding the graph).

Euler's formula is proven by induction, on a, the number of arcs.

To do: Practice #13, p. 342.

The following theorem provides some estimates on the relationship between the number of arcs and nodes that a planer graph may possess:

Theorem: For a simple, connected, planer graph with n nodes and a arcs,

  1. If the planer representation divides the plane into r regions, then

    displaymath133

  2. If tex2html_wrap_inline155 , then

    displaymath135

  3. If tex2html_wrap_inline155 and there are no cycles of length 3, then

    displaymath136

From this theorem we can deduce that tex2html_wrap_inline159 is not planer, since it has 5 nodes, and 10 arcs, and tex2html_wrap_inline161 .

Also from this theorem we can deduce that tex2html_wrap_inline163 is not planer, since it has 6 nodes, and 9 arcs, and no cycles of length 3: tex2html_wrap_inline165 .

Computer Representations of Graphs

We want to examine two different representations of graphs by a computer:

An adjacency matrix for a graph with N nodes is NxN, where the rows and columns of the matrix represent the vertices. If the graph is undirected, then the element tex2html_wrap_inline171 of the matrix is non-zero tex2html_wrap_inline173 nodes i and j are adjacent; if directed, then the element tex2html_wrap_inline171 of the matrix is non-zero tex2html_wrap_inline173 there is an arc from node i to node j.

In our textbook, the element of the matrix tex2html_wrap_inline187 , the number of arcs meeting the criteria above.

To do: Practice #16, p. 347.

For an undirected graph the adjacency matrix is symmetric (which means that we can reduce storage by about half); for a directed graph, the matrix may well be unsymmetric.

Here's a nice web page, with an example.

To do: Exercise #36, p. 357.

An adjacency list might be a better storage method for graphs with relatively few arcs: we effectively store only the non-zero entries of the adjacency matrix, in a linked list:

To do: Exercise #46, p. 358.

The redundency in drawing the adjacency list for an undirected graph is evident. This is eliminated for a directed graph:

To do: Exercise #57, p. 359.



LONG ANDREW E
Tue Feb 26 12:58:52 EST 2002