Mathematics for Computer Science

(avery) #1

Chapter 11 Simple Graphs468


ProcedureMarksimply keeps marking eligible edges, and terminates when there
are none.
Prove thatMarkterminates, and that when it does, the set of marked edges forms
a spanning tree of the original graph.


Problem 11.64.
A procedure for connecting up a (possibly disconnected) simple graph and creating
a spanning tree can be modelled as a state machine whose states are finite simple
graphs. A state isfinalwhen no further transitions are possible. The transitions are
determined by the following rules:


Procedure create-spanning-tree


  1. If there is an edgehu—vion a cycle, then deletehu—vi.

  2. If verticesuandvare not connected, then add the edgehu—vi.


(a)Draw all the possible final states reachable starting with the graph with vertices
f1;2;3;4gand edges
fh 1 — 2 i;h 3 — 4 ig:


(b)Prove that if the machine reaches a final state, then the final state will be a tree
on the vertices graph on which it started.


(c)For any graph,G^0 , letebe the number of edges inG^0 ,cbe the number of
connected components it has, andsbe the number of cycles. For each of the quan-
tities below, indicate thestrongestof the properties that it is guaranteed to satisfy,
no matter what the starting graph is.


The choices for properties are: constant,strictly increasing,strictly decreasing,
weakly increasing,weakly decreasing,none of these.


(i)e
(ii)c
(iii)s
(iv)es
(v)cCe
(vi)3cC2e
Free download pdf