The cut property Minimum spanning trees
5.1.2 The cut property
Say that in the process of building a minimum spanning tree MST, we have already chosen some edges and are so far on the right track. Which edge should we add next? The following lemma gives us a lot of flexibility in our choice. Cut property Suppose edges X are part of a minimum spanning tree of G = V, E . Pick any subset of nodes S for which X does not cross between S and V − S , and let e be the lightest edge across this partition. Then X ∪ {e} is part of some MST. A cut is any partition of the vertices into two groups, S and V − S. What this property says is that it is always safe to add the lightest edge across any cut that is, between a vertex in S and one in V − S, provided X has no edges across the cut. Let’s see why this holds. Edges X are part of some MST T ; if the new edge e also happens to be part of T , then there is nothing to prove. So assume e is not in T . We will construct a different MST T ′ containing X ∪ {e} by altering T slightly, changing just one of its edges. Add edge e to T . Since T is connected, it already has a path between the endpoints of e, so adding e creates a cycle. This cycle must also have some other edge e ′ across the cut S, V − S Figure 8.3. If we now remove this edge, we are left with T ′ = T ∪ {e} − {e ′ }, which we will show to be a tree. T ′ is connected by Property 1, since e ′ is a cycle edge. And it has the same number of edges as T ; so by Properties 2 and 3, it is also a tree. Moreover, T ′ is a minimum spanning tree. Compare its weight to that of T : weightT ′ = weightT + we − we ′ . Both e and e ′ cross between S and V − S, and e is specifically the lightest edge of this type. Therefore we ≤ we ′ , and weightT ′ ≤ weightT . Since T is an MST, it must be the case that weightT ′ = weightT and that T ′ is also an MST. Figure 5.3 shows an example of the cut property. Which edge is e ′ ? S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 143 Figure 5.3 The cut property at work. a An undirected graph. b Set X has three edges, and is part of the MST T on the right. c If S = {A, B, C, D}, then one of the minimum-weight edges across the cut S, V − S is e = {D, E}. X ∪ {e} is part of MST T ′ , shown on the right. a A B C E F D 2 2 3 3 4 1 1 2 1 b Edges X: A B C E F D MST T : A B C E F D c The cut: A B C E F D e S V − S MST T ′ : A B C E F D5.1.3 Kruskal’s algorithm
Parts
» | Komputasi | Suatu Permulaan
» Books and algorithms | Komputasi | Suatu Permulaan
» Enter Fibonacci | Komputasi | Suatu Permulaan
» Multiplication and division Basic arithmetic
» Modular addition and multiplication
» Modular exponentiation Modular arithmetic
» Euclid’s algorithm for greatest common divisor
» An extension of Euclid’s algorithm
» Modular division Modular arithmetic
» Generating random primes Primality testing
» Private-key schemes: one-time pad and AES
» Hash tables Families of hash functions
» Recurrence relations Big-O notation
» Matrix multiplication Big-O notation
» An alternative representation of polynomials
» Evaluation by divide-and-conquer The fast Fourier transform
» Interpolation The fast Fourier transform
» A closer look at the fast Fourier transform
» Exploring mazes Depth-first search in undirected graphs
» Depth-first search Connectivity in undirected graphs
» Types of edges Depth-first search in directed graphs
» Directed acyclic graphs Depth-first search in directed graphs
» Defining connectivity for directed graphs
» An efficient algorithm Strongly connected components
» Distances Breadth-first search Big-O notation
» An adaptation of breadth-first search
» An alternative derivation Dijkstra’s algorithm
» Running time Dijkstra’s algorithm
» Array Binary heap Priority queue implementations
» Negative edges Shortest paths in the presence of negative edges
» Lengths on edges Shortest paths in dags
» A greedy approach Minimum spanning trees
» The cut property Minimum spanning trees
» Kruskal’s algorithm A data structure for disjoint sets
» Prim’s algorithm Minimum spanning trees
» Huffman encoding Big-O notation
» Horn formulas Big-O notation
» Shortest paths in dags, revisited
» Longest increasing subsequences Big-O notation
» Edit distance Big-O notation
» Chain matrix multiplication Big-O notation
» Shortest paths Big-O notation
» Example: profit maximization An introduction to linear programming
» Example: production planning An introduction to linear programming
» Example: optimum bandwidth allocation
» Variants of linear programming
» Shipping oil Maximizing flow
» A closer look at the algorithm
» Bipartite matching Big-O notation
» Zero-sum games Big-O notation
» Vertices and neighbors in The algorithm
» Loose ends The simplex algorithm
» Postscript: circuit evaluation Big-O notation
» Search problems Big-O notation
» NP-complete problems Big-O notation
» The reductions Big-O notation
» Backtracking Intelligent exhaustive search
» Branch-and-bound Intelligent exhaustive search
» Vertex cover Approximation algorithms
» Traveling salesman, once more
» Graph partitioning Local search heuristics
» Qubits, superposition, and measurement
» The quantum Fourier transform
» Elementary quantum gates Two basic types of quantum circuits
» The quantum Fourier transform circuit
» Factoring as periodicity Big-O notation
Show more