Bipartite matching Big-O notation
7.3 Bipartite matching
Figure 7.7 shows a graph with four nodes on the left representing boys and four nodes on the right representing girls. 1 There is an edge between a boy and girl if they like each other for instance, Al likes all the girls. Is it possible to choose couples so that everyone has exactly one partner, and it is someone they like? In graph-theoretic jargon, is there a perfect matching? This matchmaking game can be reduced to the maximum-flow problem, and thereby to linear programming Create a new source node, s, with outgoing edges to all the boys; a new sink node, t, with incoming edges from all the girls; and direct all the edges in the original bipartite graph from boy to girl Figure 7.8. Finally, give every edge a capacity of 1. Then there is a perfect matching if and only if this network has a flow whose size equals the number of couples. Can you find such a flow in the example? Actually, the situation is slightly more complicated than just stated: what is easy to see is that the optimum integer-valued flow corresponds to the optimum matching. We would be at a bit of a loss interpreting a flow that ships 0.7 units along the edge Al–Carol, for instance 1 This kind of graph, in which the nodes can be partitioned into two groups such that all edges are between the groups, is called bipartite. Figure 7.8 A matchmaking network. Each edge has a capacity of one. s t Dan Bob Chet Danielle Beatrice Alice Carol Al 220 Algorithms Fortunately, the maximum-flow problem has the following property: if all edge capacities are integers, then the optimal flow found by our algorithm is integral . We can see this directly from the algorithm, which in such cases would increment the flow by an integer amount on each iteration. Hence integrality comes for free in the maximum-flow problem. Unfortunately, this is the exception rather than the rule: as we will see in Chapter 8, it is a very difficult problem to find the optimum solution or for that matter, any solution of a general linear program, if we also demand that the variables be integers.7.4 Duality
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