# Difference between revisions of "Chapter 12"

Jump to navigation
Jump to search

Line 19: | Line 19: | ||

===Approximation Algorithms=== | ===Approximation Algorithms=== | ||

− | :12.4 | + | :12.4. In the ''maximum satisfiability problem'', we seek a truth assignment that satisfies as many clauses as possible. Give an heuristic that always satisfies at least half as many clauses as the optimal solution. |

− | :[[12.5]] | + | :[[12.5]]. Consider the following heuristic for vertex cover. Construct a DFS tree of the graph, and delete all the leaves from this tree. What remains must be a vertex cover of the graph. Prove that the size of this cover is at most twice as large as optimal. |

+ | [[12.5|Solution]] | ||

− | :12.6 | + | :12.6. The ''maximum cut problem'' for a graph <math>G = (V, E)</math> seeks to partition the vertices <math>V</math> into disjoint sets <math>A</math> and <math>B</math> so as to maximize the number of edges <math>(a, b) \in E</math> such that <math>a \in A</math> and <math>b \in B</math>. Consider the following heuristic for maximum cut. First assign <math>v_1</math> to <math>A</math> and <math>v_2</math> to <math>B</math>. For each remaining vertex, assign it to the side that adds the most edges to the cut. Prove that this cut is at least half as large as the optimal cut. |

− | :[[12.7]] | + | :[[12.7]]. [5] In the ''bin-packing problem'', we are given n objects with weights <math>w_1, w_2, ..., w_n</math>, respectively. Our goal is to find the smallest number of bins that will hold the <math>n</math> objects, where each bin has a capacity of at most one kilogram. |

+ | :The ''first-fit heuristic'' considers the objects in the order in which they are given. For each object, place it into the first bin that has room for it. If no such bin exists, start a new bin. Prove that this heuristic uses at most twice as many bins as the optimal solution. | ||

+ | [[12.7|Solution]] | ||

− | :12.8 | + | :12.8. For the first-fit heuristic described just above, give an example where the packing it finds uses at least 5/3 times as many bins as optimal. |

− | :[[12.9]] | + | :[[12.9]]. Given an undirected graph <math>G = (V, E)</math> in which each node has degree ≤ d, show how to efficiently find an independent set whose size is at least <math>1/(d + 1)</math> times that of the largest independent set. |

+ | [[12.9|Solution]] | ||

− | :12.10 | + | :12.10. A vertex coloring of graph <math>G = (V, E)</math> is an assignment of colors to vertices of <math>V</math> such that each edge <math>(x, y)</math> implies that vertices <math>x</math> and <math>y</math> are assigned different colors. Give an algorithm for vertex coloring <math>G</math> using at most <math>\Delta + 1</math> colors, where <math>\Delta</math> is the maximum vertex degree of <math>G</math>. |

− | :[[12.11]] | + | :[[12.11]]. Show that you can solve any given Sudoku puzzle by finding the minimum vertex coloring of a specific, appropriately constructed (9×9)+9 vertex graph. |

− | + | [[12.11|Solution]] | |

===Combinatorial Optimization=== | ===Combinatorial Optimization=== |

## Revision as of 20:45, 10 September 2020

=Dealing with Hard Problems=\

## Contents

### Special Cases of Hard Problems

- 12.1. Dominos are tiles represented by integer pairs , where each of the values and are integers between 1 and . Let be a sequence of m integer pairs . The goal of the game is to create long chains such that . Dominos can be flipped, so equivalent to . For , the longest domino sequences include and .
- (a) Prove that finding the longest domino chain is NP-complete.
- (b) Give an efficient algorithm to find the longest domino chain where the numbers increase along the chain. For S above, the longest such chains are and .

- 12.2. Let be a graph and and be two distinct vertices of . Each vertex contains a given number of tokens that you can collect if you visit .
- (a) Prove that it is NP-complete to find the path from to where you can collect the greatest possible number of tokens.
- (b) Give an efficient algorithm if is a directed acyclic graph (DAG).

- 12.3. The
*Hamiltonian completion problem*takes a given graph and seeks an algorithm to add the smallest number of edges to so that it contains a Hamiltonian cycle. This problem is NP-complete for general graphs; however, it has an efficient algorithm if is a tree. Give an efficient and provably correct algorithm to add the minimum number of possible edges to tree so that plus these edges is Hamiltonian.

### Approximation Algorithms

- 12.4. In the
*maximum satisfiability problem*, we seek a truth assignment that satisfies as many clauses as possible. Give an heuristic that always satisfies at least half as many clauses as the optimal solution.

- 12.5. Consider the following heuristic for vertex cover. Construct a DFS tree of the graph, and delete all the leaves from this tree. What remains must be a vertex cover of the graph. Prove that the size of this cover is at most twice as large as optimal.

- 12.6. The
*maximum cut problem*for a graph seeks to partition the vertices into disjoint sets and so as to maximize the number of edges such that and . Consider the following heuristic for maximum cut. First assign to and to . For each remaining vertex, assign it to the side that adds the most edges to the cut. Prove that this cut is at least half as large as the optimal cut.

- 12.7. [5] In the
*bin-packing problem*, we are given n objects with weights , respectively. Our goal is to find the smallest number of bins that will hold the objects, where each bin has a capacity of at most one kilogram. - The
*first-fit heuristic*considers the objects in the order in which they are given. For each object, place it into the first bin that has room for it. If no such bin exists, start a new bin. Prove that this heuristic uses at most twice as many bins as the optimal solution.

- 12.8. For the first-fit heuristic described just above, give an example where the packing it finds uses at least 5/3 times as many bins as optimal.

- 12.9. Given an undirected graph in which each node has degree ≤ d, show how to efficiently find an independent set whose size is at least times that of the largest independent set.

- 12.10. A vertex coloring of graph is an assignment of colors to vertices of such that each edge implies that vertices and are assigned different colors. Give an algorithm for vertex coloring using at most colors, where is the maximum vertex degree of .

- 12.11. Show that you can solve any given Sudoku puzzle by finding the minimum vertex coloring of a specific, appropriately constructed (9×9)+9 vertex graph.

### Combinatorial Optimization

- 12.12

- 12.14

- 12.16

- 12.18

### "Quantum" Computing

- 12.20

- 12.22

Back to Chapter List