06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

“mcs” — 2017/3/3 — 11:21 — page 512 — #520<br />

512<br />

Chapter 12<br />

Simple Graphs<br />

The choices <strong>for</strong> properties are: constant, strictly increasing, strictly decreasing,<br />

weakly increasing, weakly decreasing, none of these.<br />

(i) e<br />

(ii) c<br />

(iii) s<br />

(iv) e<br />

s<br />

(v) c C e<br />

(vi) 3c C 2e<br />

(vii) c C s<br />

(d) Prove that one of the quantities from part (c) strictly decreases at each transition.<br />

Conclude that <strong>for</strong> every starting state, the machine will reach a final state.<br />

Problem 12.59.<br />

Let G be a weighted graph and suppose there is a unique edge e 2 E.G/ with<br />

smallest weight, that is, w.e/ < w.f / <strong>for</strong> all edges f 2 E.G/ feg. Prove that<br />

any minimum weight spanning tree (MST) of G must include e.<br />

Problem 12.60.<br />

Let G be the 4 4 grid with vertical and horizontal edges between neighboring<br />

vertices and edge weights as shown in Figure 12.35.<br />

In this problem you will practice some of the ways to build minimum weight<br />

spanning trees. For each part, list the edge weights in the order in which the edges<br />

with those weights were chosen by the given rules.<br />

(a) Construct a minimum weight spanning tree (MST) <strong>for</strong> G by initially selecting<br />

the minimum weight edge, and then successively selecting the minimum weight<br />

edge that does not create a cycle with the previously selected edges. Stop when the<br />

selected edges <strong>for</strong>m a spanning tree of G. (This is Kruskal’s MST algorithm.)<br />

For any step in Kruskal’s procedure, describe a black-white coloring of the graph<br />

components so that the edge Kruskal chooses is the minimum weight “gray edge”<br />

according to Lemma 12.9.11.<br />

(b) Grow an MST <strong>for</strong> G by starting with the tree consisting of the single vertex u<br />

and then successively adding the minimum weight edge with exactly one endpoint<br />

in the tree. Stop when the tree spans G. (This is Prim’s MST algorithm.)

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

Saved successfully!

Ooh no, something went wrong!