#  problems 

1  GT, Exercise C15.1 on page 439 Suppose G is a weighted, connected, undirected graph and e is a smallestweight edge in G. Show that there is a minimum spanning tree of G that contains e. 
2  GT, Exercise C15.2 on page 439 Suppose G is a weighted, connected, undirected, simple graph and e is a largestweight edge in G. Prove or disprove the claim that there is no minimum spanning tree of G that contains e. ( You should assume that all edge weights are distinct. ) 
3  Kleinberg and Tardos, Exercise 32 on page 107 Give an algorithm to detect whether a given undirected graph contains a cycle. If the graph contains a cycle, then your algorithm should output one. (It should not output all cycles in the graph, just one of them.) The running time of your algorithm should be O(m + n) for a graph with n nodes and m edges. 
4  Kleinberg and Tardos, Exercise 34 on page 107 Leo has a collection of n butterflies that allegedly are from species A and B. He would like to divide the n specimens into two groups, those that belong to A and those that belong to B, but it is very hard to directly label any one specimen. Leo invites an expert to study pairs of specimens side by side and, for each pair, (i,j), make a judgement as to whether that pair is from the same or different species. If the expert is uncertain about a pair, he can judge that pair to be ambiguous. The expert delivers m unambiguous judgements. Leo would like to know whether the m judgements are consistent, which is to say that it is possible to label each specimen either A or B in such a way that if any pair (i,j) was judged to be from the same species then specimens i and j jave the same label and if pair (i,j) was judged to be different then i and j have different labels. Describe an O(m+n)time algorithm that determines whether the m judgements are consistent. 
5  Kleinberg and Tardos, Exercise 312 on page 112 Given facts about people P_{1}, ..., P_{n} of forms (a) for some i and j, P_{i} died before P_{j} was born; or (b) for some i and j, the life spans of P_{i} and P_{j} overlapped.
Describe an efficient algorithm that either

6 
Given an undirected graph G = (V,E)
and special vertex v ∈ V,
describe an efficient algorithm that returns
the length of the shortest simple cycle that contains vertex v,
or 0 if there are none.
State the worstcase time complexity of your algorithm as a function of n, the number of nodes, and m, the number of edges in graph G. 
7  You have a stack of n boxes, with widths w_{i}, heights h_{i}, and depths d_{i}. The boxes cannot be rotated and can only be stacked on top of one another if each box in the stack is strictly larger than the box above it in width, height, and depth. Describe an efficient algorithm to build the tallest stack possible, where the height of a stack is the sum of the heights of each box in that stack. 
8  Describe and analyze an efficient algorithm that, given n nodes labeled from 0 to n1 and a list of undirected edges (each edge is a pair of nodes), determines whether these edges make up a valid tree. 
#  hard problems 

9 
A message is to be passed to all members of a certain underground organization.
Each member knows some of the other members and has procedures for arranging
a rendezvous with anyone he knows.
Associated with each such possible rendezvous,
say between member i and member j,
is a certain probability, p_{ij}, that the message will fall into hostile hands.
How is the message to be distributed so as to minimize the overall probability
of its being compromised?
Show that the solution is given by a spanning tree of minimum length, over a certain graph with a certain distance matrix. 
10  Baase Exercise 7.43 on page 383 If a graph is represented by an adjacency matrix, then almost any algorithm that operates on the graph will have worstcase complexity in Ω(n^{2}), where n is the number of vertices. There are, however, some problems that can be solved quickly, even when the adjacency matrix is used. Here is one.

11  Given an undirected graph G = (V,E), consisting of n vertices and m edges, with each edge labeled from the set {0,1}. Describe and analyze the worstcase time complexity of an efficient algorithm to find any cycle consisting of edges whose labels alternate 0,1. 