06.09.2021 Views

Combinatorics Through Guided Discovery, 2004a

Combinatorics Through Guided Discovery, 2004a

Combinatorics Through Guided Discovery, 2004a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

48 2. Applications of Induction and Recursion in <strong>Combinatorics</strong> and Graph Theory<br />

⇒ ·<br />

Problem 119.<br />

(a) How do the number of spanning trees of G not containing the edge<br />

e and the number of spanning trees of G containing e relate to the<br />

number of spanning trees of G − e and G/e? (h)<br />

(b) Use (G) to stand for the number of spanning trees of G (so that, for<br />

example, (G/e) stands for the number of spanning trees of G/e).<br />

Find an expression for (G) in terms of (G/e) and (G − e). This<br />

expression is called the deletion-contraction recurrence.<br />

(c) Use the recurrence of the previous part to compute the number of<br />

spanning trees of the graph in Figure 2.3.6.<br />

4<br />

3<br />

5<br />

1 2<br />

Figure 2.3.6: A graph.<br />

2.3.7 Shortest paths in graphs<br />

Suppose that a company has a main office in one city and regional offices in other<br />

cities. Most of the communication in the company is between the main office and<br />

the regional offices, so the company wants to find a spanning tree that minimizes<br />

not the total cost of all the edges, but rather the cost of communication between the<br />

main office and each of the regional offices. It is not clear that such a spanning tree<br />

even exists. This problem is a special case of the following. We have a connected<br />

graph with nonnegative numbers assigned to its edges. (In this situation these<br />

numbers are often called weights.) The (weighted) length of a path in the graph<br />

is the sum of the weights of its edges. The distance between two vertices is the<br />

least (weighted) length of any path between the two vertices. Given a vertex v, we<br />

would like to know the distance between v and each other vertex, and we would<br />

like to know if there is a spanning tree in G such that the length of the path in the<br />

spanning tree from v to each vertex x is the distance from v to x in G.<br />

Problem 120. Show that the following algorithm (known as Dijkstra’s algorithm)<br />

applied to a weighted graph whose vertices are labelled 1 to n gives,<br />

for each i, the distance from vertex 1 to i as d(i).<br />

1. Let d(1) = 0. Let d(i) =∞ for all other i. Let v(1)=1. Let v(j) =0for<br />

all other j. For each i and j, let w(i, j) be the minimum weight of an

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!