Chapter5算法概论概要1
5.4 Set cover Claim: Suppose B contains n elements and that the optimal cover consists of k sets. Then the greedy algorithm will use at most klnn sets. Approximation factor: the ratio between the optimal value of the approximation solution and that of the optimal solution. The closer the approximation factor is to one, the better the greedy algorithm performs. * * 5.4 Set cover Proof * * Exercise 5.3 * * Exercise 5.5 * * 4 Exercise 5.7 * * Exercise 5.14 * * Exercise 5.15 * * Exercise 5.16 * * Exercise 5.16 * * Earlier merge! nodes Exercise 5.17 * * Exercise 5.28 * * O(V+O(E)) O(V2+E)=O(V2) Exercise 5.31 * * EXERCISE 5.32 * * i-1 Homework: Ex 5.17, 5.32submit in the next lesson, please. * * Exercise 5.17 * * EXERCISE 5.32 * * EXERCISE 5.32 * * CHAPTER 5 Greedy algorithms 5.1 Minimum spanning trees 5.2 Huffman encoding 5.3 Horn formulas 5.4 Set cover * * 5.1 Minimum spanning trees Introductory example: how to find the cheapest network? Property 1 Removing a cycle edge cannot disconnect a graph. The solution: A tree (connected and acyclic) The minimum spanning tree (with minimum total weight) * * 5.1 Minimum spanning trees Minimum spanning tree (MST) Input: An undirected graph G=(V,E); edge weights We. Output: A tree T=(V,E’), with E’?E, that minimizes * * The MST is not unique! 5.1.1 A greedy approach Kruskal’s MST algorithm: Start with the empty graph Repeatedly add the next lightest edge that doesn’t produce a cycle Example: Add edges in increasing order of weight * * 5.1.1 A greedy approach Trees Property 1 A tree on n nodes has n-1 edges. Property 2 Any connected, undirected graph G=(V,E) with |E|=|V|-1 is a tree. Property 3 An undirected graph is a tree if and only if there is a unique path between any pair of nodes * * 5.1.2 The cut property The correctness of Kruskal’s method follows from a cut property. Cut: any partition of the vertices into two groups: S and V-S. Cut property: Suppose edges X are part of a minimum spanning t
您可能关注的文档
- Chapter 5偏晶概要1.ppt
- Chapter03 Accounting Cycle (II) Adjustments, Work Sheet and Financial Statements基础会计英文版概要1.ppt
- Chapter03 Audit Reports(审计学英文版)概要1.ppt
- Chapter03电子表格建模的艺术概要1.ppt
- Chapter 9 Internet Marketing 网络市场概要1.ppt
- Chapter06 Audit Responsibilities and Objectives(审计学英文版)概要1.ppt
- Chapter02概要1.ppt
- Chapter04_Syntax Analysis语法分析BottomUp Parsing自底向上的分析概要1.ppt
- Chapter05 Legal Liability(审计学英文版)概要1.ppt
- Chapter06_SyntaxDirected Translation语义分析续3概要1.ppt
原创力文档

文档评论(0)