Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24

Save this PDF as:

Size: px
Start display at page:

Download "Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24"

Transcription

1 Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24 The final exam will cover seven topics. 1. greedy algorithms 2. divide-and-conquer algorithms 3. dynamic programming 4. network flow 5. NP-completeness 6. Turing machines and undecidability 7. approximation algorithms The exam tests for three things. First of all, several algorithms were taught in the lectures and assigned readings, and the final will test your knowledge of those algorithms. Secondly, the course has taught concepts and techniques for designing and analyzing algorithms, and the final will test your ability to apply those concepts and techniques. Thirdly, the course has covered techniques for proving that a problem is hard, and the final will test your ability to show that a problem is NP-complete or undecidable. The final will place much more emphasis on testing concepts and techniques than on testing your knowledge of the specific algorithms that were taught so far, but a few algorithms (Kruskal, Prim, Bellman-Ford, Ford-Fulkerson) are so central to algorithm design that you should know how they work, know their running times, and be prepared to run the algorithms by hand on simple inputs. Concerning the other algorithms from the lectures and assigned readings, you are only responsible for general knowledge of what type of algorithms they are: for example, knowing that unweighted interval scheduling can be solved by a greedy algorithm but weighted interval scheduling requires dynamic programming. In the course of going over these algorithms, we covered several other related topics that are fair game for the final. Basic properties of minimum spanning trees. (Example: for any partition of the vertices into two nonempty sets, the MST contains the min-cost edge joining the two pieces of the partition.) Fast data structures: priority queues and union-find. You will not be responsible for knowing how they are implemented, only for knowing what operations they implement, and the running time per operation. Solving recurrences. (You will not have to solve anything more complicated than the ones discussed in Sections 5.1 and 5.2 of the book.) Flow related topics. You should be familiar with residual graphs, augmenting paths, s-t cuts, the max-flow min-cut theorem, and the flow integrality theorem.

2 Rice s theorem (undecidability). You should know what the theorem says. You won t be responsible for knowing the details of the proof. As stated earlier, the most important part of the final is applying the general concepts and techniques we ve been teaching. Designing algorithms. A basic question to consider when approaching an algorithm design problem is, What type of algorithm do I think I will need to design? Here are some observations that could help with the basic process of designing the algorithm. Greedy algorithms and dynamic programming algorithms tend to be applicable in cases where the problem has something to do with ordered sequences, paths, or trees. I always start out by trying the greedy algorithm and seeing if I can find a counterexample. (By the way, one type of question that I might ask on an exam is to present an incorrect algorithm for a problem and ask you to provide a counterexample showing that the algorithm is incorrect.) If I can t come up with a counterexample, I try proving the greedy algorithm is correct. If the greedy algorithm is incorrect, and the problem involves ordered sequences, paths, or trees, the next thing I try is dynamic programming. The thought process of designing a dynamic programming algorithm can be summarized as follows. 1. What is the last decision the algorithm will need to make when constructing the optimal solution? (It often involves deciding something at the end of an ordered sequence, last hop of a path, or root of a tree.) 2. Can that decision be expressed as a trivial minimization or maximization, assuming some other information was already pre-computed and stored in a table somewhere? 3. What extra information needs to be pre-computed and stored in a table? What is the structure of the table? (Is it a one-dimensional or multi-dimensional array? Are its entries indexed by natural numbers, vertices of a graph, some other index set?) 4. How must the table be initialized, and in what order do we fill in the entries after initialization? A final type of problem that lends itself to dynamic programming is problems with numerical values in the input, such as Subset Sum or Knapsack. (See Section 6.4 of Kleinberg & Tardos.) The dynamic programming algorithms for these problems use a table whose size scales with the magnitude of the numbers specified in the input. Thus, the algorithm has exponential running time in general, but runs in polynomial time when the absolute values of the numbers occurring in the input are bounded by a polynomial function of the input size. Divide and conquer algorithms tend to be applicable for problems where there is an obvious solution that doesn t use divide-and-conquer, but it is too inefficient compared to what the problem is asking for.

4 that might occur in the input. Designing a polynomial-time approximation scheme has 6 steps: 1. Round the numerical values to multiples of some common value b. 2. Design an algorithm, usually a dynamic program, that finds the exact optimum when all the values are multiples of b. The running time of this step is allowed to depend on the size of the largest number divided by b. 3. Figure out how much additive error is introduced by the rounding. 4. Set the value of b so that this additive error amounts to only ε fraction of the optimum solution value. 5. Plug this value of b into the running time analysis of the dynamic program, to obtain the final running time analysis of your algorithm. 6. Prove correctness by justifying the estimates in steps (3) and (4) as well as provimg the correctness of the dynamic program in step (2). Step (4) often requires a little bit of extra thought. How do you compare the rounding error to the optimum value, when the algorithm can t compute the optimum value? To do this one commonly needs to compute a simple upper or lower bound on the optimum solution value, similar to the way we proceed when designing and analyzing greedy approximation algorithms. Using reductions to design algorithms. The problems you are likely to want to reduce to are Bellman-Ford and the max flow algorithms (Ford-Fulkerson, Edmonds-Karp, preflow-push). One bit of advice on reductions: as you have probably discovered by now, if solving a problem using a reduction to an algorithm that was already taught, your pseudocode is allowed to contain a step that says, for example, Run the Bellman-Ford algorithm. You don t need to repeat the entire pseudocode for that algorithm. Problems that can be solved using reductions can be broken into two categories. 1. problems that must have at least one solution (the goal is to find the best solution) 2. problems that may or may not have a solution (the goal is to either correctly say that there is no answer or to give one example of a correct answer). Proofs of correctness for these two types of reductions are different. If the goal is to find the optimal solution, the reduction s proof of correctness will have three steps: 1. If you are using a reduction to problem Foo, prove that your reduction creates a valid instance of Foo. For example, if you are reducing to a shortest-path problem and then using the Bellman-Ford algorithm, prove that your reduction creates a graph with no negative-cost cycles. 2. Prove that every solution of problem Foo can be transformed into a valid solution of the original problem. (For example, if transforming a path in some graph back to a solution of the weighted interval scheduling problem, make sure to show that the resulting set of intervals has no conflicts.) 3. Prove that this transformation preserves the property of being an optimal solution. (For example, prove that a min-cost path transforms to a max-weight schedule.) Often this step

5 is easy. If the goal is to decide whether there is an answer or not, then the reduction s proof of correctness will have 2 important steps: 1. Prove that if there is a solution to the original problem, that solution can be transformed into a valid solution to the translation of the original problem 2. Prove that if there is a solution to the translation of the original problem then that solution can be transformed into a valid solution to the original problem Running Times Analyzing the running time of algorithms almost always boils down to counting loop iterations or solving a recurrence. We ve already discussed solving recurrences earlier on this information sheet. In general, this is an easy process. Just be careful about the base case of the recurrence. Ordinarily the base case refers to the case when the input size is O(1), and the algorithm s running time is also O(1), and there s nothing else to say about the base case. When an algorithm is based on reducing to some other problem (e.g. network flow), the process of analyzing its running time is different. You need to do the following steps. 1. Account for the amount of time to transform the given problem instance into an instance of some other problem (e.g. a shortest-path problem, in the case that you re reducing to the Bellman-Ford algorithm). 2. Account for the amount of time it takes to run the other algorithm (e.g. Bellman-Ford) on the transformed problem instance. 3. Express the overall running time in terms of the size original problem instance, not the transformed problem instance created by your reduction. For example, if your reduction takes a scheduling problem with J jobs and T time slots, and transforms it into a flow network with n = 2J +T vertices and m = JT +J 2 edges, and then you compute a maximum flow using the Edmonds-Karp algorithm, whose running time is O(m 2 n), then the running time of your algorithm should be expressed as O ((JT + J 2 ) 2 (2J + T )), rather than O(m 2 n). Proving Correctness Next, we come to the issue of proving correctness of algorithms. For every style of algorithm that you ve learned so far, there is a prototypical style of correctness proof. Here is a bare-bones outline of the steps in each style of proof. Proving correctness of greedy algorithms using greedy stays ahead. The algorithm makes a sequence of decisions usually, one decision is associated with each iteration of the algorithm s main loop. (A decision could be something like scheduling a job or selecting an edge of a graph to belong to a spanning tree.) We compare the algorithm s solution

7 exists a solution satisfying some constraints) the proof consists of proving both directions of the statement: there is a solution to the original problem iff there is a solution to the translated version of the problem. The first direction is generally easier. It consists of transforming an arbitrary solution to the original problem into a valid solution to the flow instance of the problem. To do this, assume that a solution to the original problem exists. Describe how to build a flow solution from it, and argue that the flow solution is valid (i.e. obeys capacity constraints, obeys flow conservation, and has the desired flow value). The second direction is generally slightly harder. It consists of transforming an arbitrary solution to the flow instance of the problem into a valid solution to the original problem. It often requires you to use the fact that if all the capacities are integers then there is an integer flow. To do this, assume that a solution to the flow instance exists. Use it to construct a solution to the original problem. Argue that the solution obeys all the required constraints. Reductions to min cut are similar. NP-completeness proofs Sometimes the goal is not to design an algorithm, but to prove that designing an algorithm is the wrong strategy. In NP-completeness problems the goal is to prove that the given problem is at least as hard as other NP-complete problems (for which no polynomial algorithms are known). The proof that a problem Foo is NP-complete has 5 steps: Foo is in NP: Show that there is a polynomial time verifier for Foo. The polynomial time verifier takes an instance of the problem Foo and a possible answer to that instance and, in polynomial time, answers yes if the possible answer is a correct solution and no if the possible answer is not a correct solution. Design a reduction FROM some NP-complete problem TO Foo: Pick an NP-complete problem (more on this below). Use an oracle that solves Foo to solve the NP-complete problem. Describe how to translate an arbitrary instance of the NP-complete problem into an equivalent instance of Foo. Sometimes the translation will be straightforward and will basically consist of mapping a type of object in one problem to a type of object in the other problem (like in the dodgeball problem where we map a pair of team assignments to a color). Other times the reduction will require the construction of gadgets (like in the reduction from 3-SAT to IND-SET). When reducing from 3-SAT in general, there will be gadgets for binary decisions, and gadgets for enforcing the three-strikes-and-you re-out rule for clauses. The reduction takes polynomial time: Calculate the running time of the reduction. Make sure that you aren t creating exponentially many nodes (or actors or routers... ). Translate arbitrary soln to NP-complete problem instance into soln to Foo instance: This is generally the easier direction. Translate arbitrary soln to Foo instance into soln to NP-complete problem instance: This is generally the harder direction. Don t reduce the wrong way. Remember, you want to reduce some NP-complete problem to the target problem. If there is a way to reduce the NP-complete problem to the target problem,

9 Undecidability You may be asked to answer a question about Turing machines, languages, and decidability. These questions should be easy to distinguish from other types of questions. The two types of questions you may encounter are the following. Judging if a language is recursive, r.e., or neither. Judging which of the three alternatives usually boils down to: 1. Can I decide whether or not x belongs to L, by simulating a computation that is guaranteed to finish in a bounded amount of time? (In other words, there is some finite time such that, if the computation hasn t finished by then, I can be sure it s never going to finish.) If so, L is recursive. 2. Can I simulate a computation such that, if something happens during the simulation, then I know for sure that x is in L, but there s no way to know in advance how long I have to wait for that thing to happen? If so, L is r.e. 3. If there s no finite amount of evidence that could convince me that x is in L, then L is neither r.e. nor recursive. (Example, suppose L is the set of all M; x such that M does not halt when its input is x. There s no finite amount of evidence I could provide you with, that would convince you that M is never going to halt on input x. So this set is neither r.e. nor recursive.) Proving a language is recursive, r.e., or neither. The proof works either by constructing a Turing machine which solves the problem or by assuming the existence of a Turning machine which solves the problem and using it to solve either the Halting problem or its complement. 1. Proving that a language L is r.e. or recursive boils down to describing, in plain English, a computation that accepts or decides L. To do this, you re allowed to embed useful things such as a universal Turing machine as subroutines of your computation. You re also allowed to assume that your Turing machine has any (bounded, independent of the input size) number of extra tapes on which to store auxiliary information, e.g. a counter that counts the number of steps in a simulation that a universal Turing machine is running. 2. Proving that L is not recursive usually boils down to reducing FROM the halting problem to L. 3. Proving that L is not even r.e. usually boils down to reducing FROM the complement of the halting problem to L. In both cases, the standard advice about reductions (see NP-completeness section) applies. The difference is that instead of gadgets (as in NP-completeness reductions) the notion of reduction here tends to revolve around tweaking a universal Turing machine simulation so that some taboo behavior happens if and only if the universal Turing machine wants to halt and output yes. (An example of this type of tweaking is the reduction used to prove that the language R 3 is not recursive in Homework 8, problem 1.)

2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

Near Optimal Solutions

Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

5.1 Bipartite Matching

CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson

Lecture 6: Approximation via LP Rounding

Lecture 6: Approximation via LP Rounding Let G = (V, E) be an (undirected) graph. A subset C V is called a vertex cover for G if for every edge (v i, v j ) E we have v i C or v j C (or both). In other

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness

Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

Guessing Game: NP-Complete?

Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES 2. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

The Classes P and NP

The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

Approximation Algorithms

Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

Lecture 7: Approximation via Randomized Rounding

Lecture 7: Approximation via Randomized Rounding Often LPs return a fractional solution where the solution x, which is supposed to be in {0, } n, is in [0, ] n instead. There is a generic way of obtaining

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

CSC 373: Algorithm Design and Analysis Lecture 16

CSC 373: Algorithm Design and Analysis Lecture 16 Allan Borodin February 25, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 17 Announcements and Outline Announcements

A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi TAs: Y. Chen, G. Hall, J. Ye Fall 2014 1 Why computational complexity? What is computational

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing

CS420/520 Algorithm Analysis Spring 2010 Lecture 04

CS420/520 Algorithm Analysis Spring 2010 Lecture 04 I. Chapter 4 Recurrences A. Introduction 1. Three steps applied at each level of a recursion a) Divide into a number of subproblems that are smaller

Problem Set 7 Solutions

8 8 Introduction to Algorithms May 7, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 25 Problem Set 7 Solutions This problem set is due in

Answers to Homework 1

Answers to Homework 1 p. 13 1.2 3 What is the smallest value of n such that an algorithm whose running time is 100n 2 runs faster than an algorithm whose running time is 2 n on the same machine? Find the

COMS4236: Introduction to Computational Complexity. Summer 2014

COMS4236: Introduction to Computational Complexity Summer 2014 Mihalis Yannakakis Lecture 17 Outline conp NP conp Factoring Total NP Search Problems Class conp Definition of NP is nonsymmetric with respect

Memoization/Dynamic Programming. The String reconstruction problem. CS125 Lecture 5 Fall 2016

CS125 Lecture 5 Fall 2016 Memoization/Dynamic Programming Today s lecture discusses memoization, which is a method for speeding up algorithms based on recursion, by using additional memory to remember

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)

Steven Skiena. skiena

Lecture 3: Recurrence Relations (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Argue the solution to T(n) =

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

Reading 7 : Program Correctness

CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Instructors: Beck Hasti, Gautam Prakriya Reading 7 : Program Correctness 7.1 Program Correctness Showing that a program is correct means that

Trees and structural induction

Trees and structural induction Margaret M. Fleck 25 October 2010 These notes cover trees, tree induction, and structural induction. (Sections 10.1, 4.3 of Rosen.) 1 Why trees? Computer scientists are obsessed

8.1 Makespan Scheduling

600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Dynamic Programing: Min-Makespan and Bin Packing Date: 2/19/15 Scribe: Gabriel Kaptchuk 8.1 Makespan Scheduling Consider an instance

Lecture 7: NP-Complete Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

princeton univ. F 13 cos 521: Advanced Algorithm Design Lecture 6: Provable Approximation via Linear Programming Lecturer: Sanjeev Arora

princeton univ. F 13 cos 521: Advanced Algorithm Design Lecture 6: Provable Approximation via Linear Programming Lecturer: Sanjeev Arora Scribe: One of the running themes in this course is the notion of

CAD Algorithms. P and NP

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using

6.852: Distributed Algorithms Fall, 2009. Class 2

.8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Jade Yu Cheng ICS 311 Homework 10 Oct 7, 2008

Jade Yu Cheng ICS 311 Homework 10 Oct 7, 2008 Question for lecture 13 Problem 23-3 on p. 577 Bottleneck spanning tree A bottleneck spanning tree of an undirected graph is a spanning tree of whose largest

Minimum cost maximum flow, Minimum cost circulation, Cost/Capacity scaling

6.854 Advanced Algorithms Lecture 16: 10/11/2006 Lecturer: David Karger Scribe: Kermin Fleming and Chris Crutchfield, based on notes by Wendy Chu and Tudor Leu Minimum cost maximum flow, Minimum cost circulation,

1. Please write your name in the blank above, and sign & date below. 2. Please use the space provided to write your solution.

Name : Instructor: Marius Ionescu Instructions: 1. Please write your name in the blank above, and sign & date below. 2. Please use the space provided to write your solution. 3. If you need extra pages

Lecture 3: Linear Programming Relaxations and Rounding

Lecture 3: Linear Programming Relaxations and Rounding 1 Approximation Algorithms and Linear Relaxations For the time being, suppose we have a minimization problem. Many times, the problem at hand can

Definition 11.1. Given a graph G on n vertices, we define the following quantities:

Lecture 11 The Lovász ϑ Function 11.1 Perfect graphs We begin with some background on perfect graphs. graphs. First, we define some quantities on Definition 11.1. Given a graph G on n vertices, we define

Chapter 4. Trees. 4.1 Basics

Chapter 4 Trees 4.1 Basics A tree is a connected graph with no cycles. A forest is a collection of trees. A vertex of degree one, particularly in a tree, is called a leaf. Trees arise in a variety of applications.

1 Definition of a Turing machine

Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

Intro. to the Divide-and-Conquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4

Intro. to the Divide-and-Conquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4 I. Algorithm Design and Divide-and-Conquer There are various strategies we

COLORED GRAPHS AND THEIR PROPERTIES

COLORED GRAPHS AND THEIR PROPERTIES BEN STEVENS 1. Introduction This paper is concerned with the upper bound on the chromatic number for graphs of maximum vertex degree under three different sets of coloring

GRAPH THEORY and APPLICATIONS. Trees

GRAPH THEORY and APPLICATIONS Trees Properties Tree: a connected graph with no cycle (acyclic) Forest: a graph with no cycle Paths are trees. Star: A tree consisting of one vertex adjacent to all the others.

Lecture 2: Universality

CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

On the Unique Games Conjecture

On the Unique Games Conjecture Antonios Angelakis National Technical University of Athens June 16, 2015 Antonios Angelakis (NTUA) Theory of Computation June 16, 2015 1 / 20 Overview 1 Introduction 2 Preliminary

CSE 101: Design and Analysis of Algorithms Homework 4 Winter 2016 Due: February 25, 2016

CSE 101: Design and Analysis of Algorithms Homework 4 Winter 2016 Due: February 25, 2016 Exercises (strongly recommended, do not turn in) 1. (DPV textbook, Problem 7.11.) Find the optimal solution to the

Introduction to Algorithms. Part 3: P, NP Hard Problems

Introduction to Algorithms Part 3: P, NP Hard Problems 1) Polynomial Time: P and NP 2) NP-Completeness 3) Dealing with Hard Problems 4) Lower Bounds 5) Books c Wayne Goddard, Clemson University, 2004 Chapter

max cx s.t. Ax c where the matrix A, cost vector c and right hand side b are given and x is a vector of variables. For this example we have x

Linear Programming Linear programming refers to problems stated as maximization or minimization of a linear function subject to constraints that are linear equalities and inequalities. Although the study

1 Basic Definitions and Concepts in Graph Theory

CME 305: Discrete Mathematics and Algorithms 1 Basic Definitions and Concepts in Graph Theory A graph G(V, E) is a set V of vertices and a set E of edges. In an undirected graph, an edge is an unordered

Discrete Mathematics, Chapter 3: Algorithms

Discrete Mathematics, Chapter 3: Algorithms Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 3 1 / 28 Outline 1 Properties of Algorithms

Lecture 1: Course overview, circuits, and formulas

Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik

Fairness in Routing and Load Balancing

Fairness in Routing and Load Balancing Jon Kleinberg Yuval Rabani Éva Tardos Abstract We consider the issue of network routing subject to explicit fairness conditions. The optimization of fairness criteria

Exponential time algorithms for graph coloring

Exponential time algorithms for graph coloring Uriel Feige Lecture notes, March 14, 2011 1 Introduction Let [n] denote the set {1,..., k}. A k-labeling of vertices of a graph G(V, E) is a function V [k].

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

Discuss the size of the instance for the minimum spanning tree problem.

3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION REDUCIBILITY ( LECTURE 16) SLIDES FOR 15-453 SPRING 2011 1 / 20 THE LANDSCAPE OF THE CHOMSKY HIERARCHY ( LECTURE 16) SLIDES FOR 15-453 SPRING 2011 2 / 20 REDUCIBILITY

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

A TM. Recall the A TM language: A TM = { M, w M is a TM and M accepts w.} is undecidable. Theorem: The language. p.2/?

p.1/? Reducibility We say that a problem Q reduces to problem P if we can use P to solve Q. In the context of decidability we have the following templates : If A reduces to B and B is decidable, then so

Divide and Conquer My T. UF

Introduction to Algorithms Divide and Conquer @ UF General Approach Divide the problem into a number of subproblems that are smaller instances of the same problem Conquer the subproblems by solving them

CS2223 Algorithms B Term 2013 Exam 2 Solutions

CS2223 Algorithms B Term 2013 Exam 2 Solutions Dec. 3, 2013 By Prof. Carolina Ruiz Dept. of Computer Science WPI PROBLEM 1: Solving Recurrences (15 points) Solve the recurrence T (n) = 2T (n/3) + n using

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

Lecture 2: March 20, 2015

Automatic Software Verification Spring Semester, 2015 Lecture 2: March 20, 2015 Lecturer: Prof. Mooly Sagiv Scribe: Kalev Alpernas and Elizabeth Firman 2.1 Introduction In this lecture we will go over

Computer Science 211 Data Structures Mount Holyoke College Fall Topic Notes: Recursion and Mathematical Induction

Computer Science 11 Data Structures Mount Holyoke College Fall 009 Topic Notes: Recursion and Mathematical Induction Recursion An important tool when trying to solve a problem is the ability to break the

Satisfiability of Boolean Expressions

Satisfiability of Boolean Expressions In the previous section, we have analysed in great detail one particular problem reachability in directed graphs. The reason for the attention devoted to this one

Solutions to Exercises 8

Discrete Mathematics Lent 2009 MA210 Solutions to Exercises 8 (1) Suppose that G is a graph in which every vertex has degree at least k, where k 1, and in which every cycle contains at least 4 vertices.

Tutorial 8. NP-Complete Problems

Tutorial 8 NP-Complete Problems Decision Problem Statement of a decision problem Part 1: instance description defining the input Part 2: question stating the actual yesor-no question A decision problem

New Zealand Mathematical Olympiad Committee. Induction

New Zealand Mathematical Olympiad Committee Induction Chris Tuffley 1 Proof by dominoes Mathematical induction is a useful tool for proving statements like P is true for all natural numbers n, for example

Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

Lecture Notes on Spanning Trees

Lecture Notes on Spanning Trees 15-122: Principles of Imperative Computation Frank Pfenning Lecture 26 April 26, 2011 1 Introduction In this lecture we introduce graphs. Graphs provide a uniform model

The Greedy Method. Fundamental Techniques. The Greedy Method. Fractional Knapsack Problem

Fundamental Techniques There are some algorithmic tools that are quite specialised. They are good for problems they are intended to solve, but they are not very versatile. There are also more fundamental

Minimum Spanning Trees

Minimum Spanning Trees Algorithms and 18.304 Presentation Outline 1 Graph Terminology Minimum Spanning Trees 2 3 Outline Graph Terminology Minimum Spanning Trees 1 Graph Terminology Minimum Spanning Trees

1. R In this and the next section we are going to study the properties of sequences of real numbers.

+a 1. R In this and the next section we are going to study the properties of sequences of real numbers. Definition 1.1. (Sequence) A sequence is a function with domain N. Example 1.2. A sequence of real

Markov chains and Markov Random Fields (MRFs)

Markov chains and Markov Random Fields (MRFs) 1 Why Markov Models We discuss Markov models now. This is the simplest statistical model in which we don t assume that all variables are independent; we assume

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

Scientiae Mathematicae Japonicae Online, Vol. 10, (2004), 431 437 431 JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS Ondřej Čepeka and Shao Chin Sung b Received December May 12, 2003; revised February

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints

3. Recurrence Recursive Definitions. To construct a recursively defined function:

3. RECURRENCE 10 3. Recurrence 3.1. Recursive Definitions. To construct a recursively defined function: 1. Initial Condition(s) (or basis): Prescribe initial value(s) of the function.. Recursion: Use a

Introduction to Relations

CHAPTER 7 Introduction to Relations 1. Relations and Their Properties 1.1. Definition of a Relation. Definition: A binary relation from a set A to a set B is a subset R A B. If (a, b) R we say a is related

Introduction to Algorithms March 10, 2004 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser Quiz 1.

Introduction to Algorithms March 10, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Quiz 1 Quiz 1 Do not open this quiz booklet until you are directed

Lecture 2: The Complexity of Some Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 2: The Complexity of Some Problems David Mix Barrington and Alexis Maciel July 18, 2000

Good luck, veel succes!

Final exam Advanced Linear Programming, May 7, 13.00-16.00 Switch off your mobile phone, PDA and any other mobile device and put it far away. No books or other reading materials are allowed. This exam

Introduction to computer science

Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes.

Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the

Data Structures and Algorithms Written Examination

Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where

Oh Yeah? Well, Prove It.

Oh Yeah? Well, Prove It. MT 43A - Abstract Algebra Fall 009 A large part of mathematics consists of building up a theoretical framework that allows us to solve problems. This theoretical framework is built

Discrete Mathematics, Chapter 5: Induction and Recursion

Discrete Mathematics, Chapter 5: Induction and Recursion Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 5 1 / 20 Outline 1 Well-founded

The Selection Problem

The Selection Problem The selection problem: given an integer k and a list x 1,..., x n of n elements find the k-th smallest element in the list Example: the 3rd smallest element of the following list

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

A. V. Gerbessiotis CS Spring 2014 PS 3 Mar 24, 2014 No points

A. V. Gerbessiotis CS 610-102 Spring 2014 PS 3 Mar 24, 2014 No points Problem 1. Suppose that we insert n keys into a hash table of size m using open addressing and uniform hashing. Let p(n, m) be the

Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013

Dynamic programming Doctoral course Optimization on graphs - Lecture.1 Giovanni Righini January 1 th, 201 Implicit enumeration Combinatorial optimization problems are in general NP-hard and we usually

Solving systems of linear equations over finite fields

Solving systems of linear equations over finite fields June 1, 2007 1 Introduction 2 3 4 Basic problem Introduction x 1 + x 2 + x 3 = 1 x 1 + x 2 = 1 x 1 + x 2 + x 4 = 1 x 2 + x 4 = 0 x 1 + x 3 + x 4 =

Diversity Coloring for Distributed Data Storage in Networks 1

Diversity Coloring for Distributed Data Storage in Networks 1 Anxiao (Andrew) Jiang and Jehoshua Bruck California Institute of Technology Pasadena, CA 9115, U.S.A. {jax, bruck}@paradise.caltech.edu Abstract