Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes

Size: px
Start display at page:

Download "Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes"

Transcription

1 Computational Complexity and Implications for Security DRAFT Notes on Infeasible Computation for MA/CS 109 Leo Reyzin with the help of Nick Benes The Study of Computational Complexity Let s summarize what we ve done. We started out saying everything is bits: numbers, text, formatting, pictures, music, and even programs themselves. This gave us a model of information (bits) and computation (instructions, written down as bits, executed on hardware built out of gates). Once we have a precise model, we can reason what is possible and what is not. This model, in particular, enabled us to prove that there are important questions whose answers cannot be computed at all (such as whether the program will halt or whether a Diophantine equations has solutions). On the other hand, it also enabled us to specify algorithms for solving certain questions quite efficiently (such as searching an index, sorting a list, or finding the shortest path in a graph). But between the uncomputable questions and the efficiently computable ones, there are a whole lot of very interesting questions whose answers are computable, but for which the computation would take a very long time, so long that it doesn t seem to be better than not being able to solve them at all. The area of computer science that studies how long (or how much memory or other resources) computation takes is called complexity theory. For instance, take the game of checkers (a similar fact is true for the Chinese game of go). Generalize the game to allow for boards of various sizes: N N instead of the fixed 8 8. Consider a particular position (a position includes information about whose turn it is). Note that because this is a game of skill alone (i.e., luck is not involved), one of the three conditions must hold when the players start from that position: either there is a way for white to win no matter what black does, or a way for black to win no matter what white does, or a way for each player to force a tie no matter what the other player does. So it is natural to ask which one of the three situations holds. It turns that the answer to this question is computable, but even the best possible algorithm will take a very long time for some starting positions. Namely, the number of steps the algorithm will take (for at least some of the possible starting positions) is an exponential function of N (the size of the board). In other words, even for modest board sizes, the problem takes a very long time. Solving checkers is an example of an exponential-time problem. In computer science, a problem is generally considered feasible if there is an algorithm that, for any input of size N (such as N numbers to sort, or N nodes in a graph in which we need to find the shortest path) finds the solution using no more steps than than N raised to some (small) power, such as N 2 or N 3 (or N log N, which is less than N 2 ). Since this number of steps is at most a polynomial function of N, such problems are called polynomialtime problems and the algorithms to solve them are called polynomial-time algorithms. For example, Dijkstra s algorithm takes at most N 2 steps on an input of size N. Therefore, it is a polynomial-time algorithm and the problem that it solves the shortest path problem is a polynomial-time problem. 1

2 Polynomial-time problems are numerous and include the problems you have already seen: finding an element in a list, sorting a list, or finding the shortest path in a graph. The class of all such problems is denoted by the letter P. Exponential-time problems are not in P: they are much worse than polynomial-time problems. Thus, some problems (such as finding the shortest path in a graph) are known to be polynomial-time, while some (such as solving checkers) are known to be exponential-time. Of course, there are also problems in between, and problems even worse than exponential time. However, there are also many problems for which we simply don t know what the best algorithm can do, even though we ve been studying them for many years. Among those, one class of problems is very important. We discuss it next. NP For simplicity, let us focus on problems that demand only a yes/no answer. Consider the following problem. Traveling Salesman Problem: Given a graph (i.e., nodes, edges connecting nodes, and prices on each edge), as well as some budget b, find if there is a path covering all the nodes whose total cost is no more than the budget b. Note that this problem seems easier than asking to find the best possible route: because it is only a yes/no question, it merely asks whether there is a route priced at less than or equal to b. However, it turns out that it s only slightly easier: if this yes/no question can be answered, then finding the best possible route is not much harder. More importantly, this problem is very different from the shortest path problem, which asks only how to get from one point to another regardless of what other points you cover. The following interactive web page allows you to play with an example of the Traveling Salesman Problem. Try to find the optimal route, or even just a route that comes in under $900. The naive approach is to list all the possible routes and then check them all. Assume you have an example with 7 cities that are all connected. Then you have seven choices for the starting city; given a starting city, you have six for the second; given the first two cities, you have five choices for the third; etc. This gives you = 7! = 5040 possible routes. But suppose you have a graph of 26 nodes. By the same argument, enumerating all possible routes on such a graph will take 26! (four followed by 26 zeroes). That s a very large number: if a computer enumerating 1 billion paths per second started at the birth of the universe, it would be finishing up right about now. More generally, on N cities to you need to check N! routes, which is even worse than exponential time. Of course, checking all routes is not the only possible approach. For the shortest path problem, for example, we found a much better way than checking all routes (namely, Dijkstra s algorithm): it took only about N 2 steps, which is polynomial. Maybe there is a way that involves a polynomial number of steps for this problem, too? It turns out that, despite decades of research, no one knows a polynoimal-time algorithm to solve this problem. It is important to reiterate what a polynomial-time algorithm means. A polynomialtime algorithm must take a number of steps that is some pre-specified polynomial of N (such as N 2 or N 3 ) for every input of size N. It s not good enough to have algorithm that works 2

3 for some inputs it has to work in the given time no matter what input of size N you give it. Unlike the checkers example above, this problem has a very important feature: if the answer is yes, then there is a proof that can be verified easily (in polynomial time) The proof, in this case, is just the list of nodes in the order you visit them. It is indeed easy to verify: verification simply requires adding the costs of all the edges traveled and seeing if it comes in under the budget b. (Note that there is not necessarily a short proof if the answer is no. ) There are many other problems with the above feature. Here we name just a few more; there are thousands of interesting ones identified in the scientific literature. Our emphasis is on graph problems, because they are the easiest examples to state given the background introduced in the class. However, problems with the above feature don t have to have anything to do with grpahs, and many do not. Clique Consider a large undirected graph, such as the Facebook graph in which users are nodes and the friend relation forms edges. Suppose you want to know if there is a group of K nodes that are all connected to each other (in the Facebook example, that means K people are all each other s friends). Such a groups is called clique. Naturally, if the answer is yes, then there is an easily (polynomial-time) verifiable proof: if I give you the K nodes, you can easily check that they are all each other s friends by verifying that there is an edge between every pair (there are K(K 1)/2 < K 2 pairs to consider). 3-Coloring Consider a large undirected graph on N nodes. Ask whether it is possible, using only three different colors, to color each node so that no nodes that are connected by an edge are the same color. Again, if the answer is yes, then there is an easily (polynomialtime) verifiable proof: if I tell you the color of each node, you can check that no connected pair has the same color, by considering all pairs of nodes (there are N(N 1)/2 < N 2 pairs to consider). Scheduling with Precedence Constraints Suppose you have N tasks, some of which must precede others (for example, if the tasks relate to building a house, you can t paint the walls until you build them). Each task comes with the amount of time needed to complete it. Given a number m of workers and a time t, figure out if it is possible to complete all the tasks in time t. Proving Theorems Given a (precisely written down) mathematical statement, find out if it has a proof of length at most N. Naturally, if the answer is yes, then there is a proof that can be efficiently verified (because verifying mathematical proofs is something that can be automated). 3

4 Any yes/no problem with this feature (namely, that if the answer is yes, then there is a proof that can be verified in polynomial-time) is said to belong to a class of problems called NP (for nondeterministic polynomial time). So can problems in NP be solved efficiently (that is, in polynomial time)? In other words, is the class NP exactly the same class of problems as the class P? Or, yet in other words, does finding a proof have to be much harder than verifying it? Computer scientists have been working on this question since the early 1970s, after Steven Cook, Richard Karp, and Leonid Levin (now at BU CS) described the class NP. The question is still open. In 2000, the Clay Mathematics Institute announced a list of seven Millennium Problems that are particularly important for mathematics, each with a $1 million prize. Whether P=NP is one of them. Fortunately, to claim the $1 million prize, you don t have to find an efficient algorithm for every problem in NP. It has been proven that finding an efficient algorithm for any one of the above problems (Traveling Salesman, Clique, 3-Coloring, Schedule with Precedence Constraints, or Proving Theorems) will suffice: such an efficient algorithm can be converted for an efficient algorithm for any other problem in NP. In fact, there are many important problems with the same property as the above problems; namely, finding a polynomial-time algorithm for any of them will prove that P = NP, because it will give an polynomial-time algorithm for all other problems in NP. Such special problems are called NP-complete. Most computer scientists, however, believe that P NP. That is, they believe that an efficient algorithm for the Traveling Salesman Problem does not exist. If it did, too many important problems that people have been working on for centuries would turn out to be easy. In fact, proving mathematical theorems would become too easy! Cryptography So this seems depressing, maybe even more depressing than knowing that we can t do something. With these problems, we know we can do them but it would take so long that we might as well not be able to do them at all! And, moreover, we can t even prove that we can t solve them faster. But while your inability to do something is bad for you, the bad guys inability to do something is good for you. Thus, if we can use hardness of computation to our advantage, maybe this depressing news has a silver lining. Suppose I want to have an account on a remote server (as we typically do for , BU grades, on-line shopping, etc.). I could pick a password (like SuperSecret109 ) and the remote server can store it. Every time I log in, it would compare what I enter to what it stores. But then if someone were to steal or hack into the server, they would get my password that the server stores. Worse, I probably use the same password for other accounts, too, so they would gain access to many of my accounts. A better way would be to use the defining property of NP problems: that verification can be done efficiently. For example, instead of choosing a password, I could choose a 3-colorable graph. Note that this is much easier than 3-coloring a given graph: since I get to choose, I can start with the random colors on the nodes and then draw in the edges to make sure that no two nodes of the same color are connected. I would give the graph to the server and keep 4

5 the 3-coloring to myself (on my personal laptop, for example). Then my password is the coloring, but it s not stored on the server. It s easy for the server to check if I ve entered a valid coloring, but if someone steals or hacks into the server, all they get is the graph. There server doesn t know a valid 3-coloring, but merely verifies it every time I log in, and then erases it to make sure it can t get stolen. Thus, using a computationally hard problem, I have split my password into a public portion that the server knows (and, in fact, anyone can know) and a secret portion that only I know. In fact, given the prominence of the problem, probably people won t bother trying to hack into the server, because if they figure out a way to solve an arbitrary 3-coloring problem, then they ll go for the $1 million Millennium Prize rather than my accounts. Leo SuperSecret109 Coloring Server SuperSecret109 (has to be secret) Graph (not secret) The fundamental insight to take from this example is that to verify someone s secret (and, thus, someone s identity), you don t need to know any secrets. Of course, as you know from using passwords, no one actually uses three-colorings for passwords. That would be too much of a pain. However, the fundamental still applies: when you log in to a competent service, they don t know your passwords. The server doesn t store your password, but stores only something that can verify your password. Getting the original password back from it is computationally hard (likely harder than simply trying all possible passwords). Another reason three-coloring is not used in realy life is that even if humans could remember colorings (or delegate that task to a laptop/cell phone/etc.), the 3-coloring problem is not a very convenient example, because, even though for many graphs 3-coloring is hard, there are also many graphs for which it s easy. I would have to do extra work to generate a graph for which it s hard. It would be nice to use a problem that seems always hard. We will talk about such problems in later lectures. 5

Nondeterministic Polynomial Time

Nondeterministic Polynomial Time Nondeterministic Polynomial Time CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2017 1/1 A clique is a subset of vertices that are pairwise adjacent {1,

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Frank de Zeeuw EPFL 2012 Today Introduction Graph problems - What combinatorial things will we be optimizing? Algorithms - What kind of solution are we looking for? Linear Programming

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation-6: Hardness of Inference Contents 1 NP-Hardness Part-II

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can

More information

Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets

Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets Saul Glasman 14 September 2016 Let s give the definition of an open subset of R. Definition 1. Let U R. We

More information

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 While we have good algorithms for many optimization problems, the previous lecture showed that many

More information

Lecture 24: More Reductions (1997) Steven Skiena. skiena

Lecture 24: More Reductions (1997) Steven Skiena.   skiena Lecture 24: More Reductions (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that subgraph isomorphism

More information

CDs & DVDs: Different Types of Disk Explained

CDs & DVDs: Different Types of Disk Explained CDs & DVDs: Different Types of Disk Explained C 200 / 1 Don t Waste Money Buying the Wrong Type Find Out Which Disks Your PC Can Use! Your PC almost certainly has at least one CD/DVD drive. In its most

More information

4.1 Review - the DPLL procedure

4.1 Review - the DPLL procedure Applied Logic Lecture 4: Efficient SAT solving CS 4860 Spring 2009 Thursday, January 29, 2009 The main purpose of these notes is to help me organize the material that I used to teach today s lecture. They

More information

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

Recitation 4: Elimination algorithm, reconstituted graph, triangulation Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation 4: Elimination algorithm, reconstituted graph, triangulation

More information

1 Counting triangles and cliques

1 Counting triangles and cliques ITCSC-INC Winter School 2015 26 January 2014 notes by Andrej Bogdanov Today we will talk about randomness and some of the surprising roles it plays in the theory of computing and in coding theory. Let

More information

Solution of P versus NP problem

Solution of P versus NP problem Algorithms Research 2015, 4(1): 1-7 DOI: 105923/jalgorithms2015040101 Solution of P versus NP problem Mustapha Hamidi Meknes, Morocco Abstract This paper, taking Travelling Salesman Problem as our object,

More information

9.1 Cook-Levin Theorem

9.1 Cook-Levin Theorem CS787: Advanced Algorithms Scribe: Shijin Kong and David Malec Lecturer: Shuchi Chawla Topic: NP-Completeness, Approximation Algorithms Date: 10/1/2007 As we ve already seen in the preceding lecture, two

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17 5.1 Introduction You should all know a few ways of sorting in O(n log n)

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

Steven Skiena. skiena

Steven Skiena.   skiena Lecture 22: Introduction to NP-completeness (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Among n people,

More information

MITOCW watch?v=zm5mw5nkzjg

MITOCW watch?v=zm5mw5nkzjg MITOCW watch?v=zm5mw5nkzjg The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

P and NP (Millenium problem)

P and NP (Millenium problem) CMPS 2200 Fall 2017 P and NP (Millenium problem) Carola Wenk Slides courtesy of Piotr Indyk with additions by Carola Wenk CMPS 2200 Introduction to Algorithms 1 We have seen so far Algorithms for various

More information

p x i 1 i n x, y, z = 2 x 3 y 5 z

p x i 1 i n x, y, z = 2 x 3 y 5 z 3 Pairing and encoding functions Our aim in this part of the course is to show that register machines can compute everything that can be computed, and to show that there are things that can t be computed.

More information

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Relations Let s talk about relations! Grade 6 Math Circles November 6 & 7 2018 Relations, Functions, and

More information

Lecture 1: Overview

Lecture 1: Overview 15-150 Lecture 1: Overview Lecture by Stefan Muller May 21, 2018 Welcome to 15-150! Today s lecture was an overview that showed the highlights of everything you re learning this semester, which also meant

More information

Time Complexity of an Algorithm

Time Complexity of an Algorithm CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 335] Time Complexity of an Algorithm Time complexity of an algorithm: the function T (n) that describes the (worst-case) running time

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions Algorithm Design Patterns and Anti-Patterns Analysis of Algorithms Algorithm design patterns. Ex. Greed. O(n 2 ) Dijkstra s SSSP (dense) Divide-and-conquer. O(n log n) FFT. Dynamic programming. O(n 2 )

More information

CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel

CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel We will now discuss computer programs, a concrete manifestation of what we ve been calling

More information

COMP260 Spring 2014 Notes: February 4th

COMP260 Spring 2014 Notes: February 4th COMP260 Spring 2014 Notes: February 4th Andrew Winslow In these notes, all graphs are undirected. We consider matching, covering, and packing in bipartite graphs, general graphs, and hypergraphs. We also

More information

Problem One: A Quick Algebra Review

Problem One: A Quick Algebra Review CS103A Winter 2019 Solutions for Week One Handout 01S Problem One: A Quick Algebra Review In the first week of CS103, we'll be doing a few proofs that will require some algebraic manipulations and reasoning

More information

Algorithms Exam TIN093/DIT600

Algorithms Exam TIN093/DIT600 Algorithms Exam TIN093/DIT600 Course: Algorithms Course code: TIN 093 (CTH), DIT 600 (GU) Date, time: 22nd October 2016, 14:00 18:00 Building: M Responsible teacher: Peter Damaschke, Tel. 5405 Examiner:

More information

NP-Complete Problems

NP-Complete Problems 1 / 34 NP-Complete Problems CS 584: Algorithm Design and Analysis Daniel Leblanc 1 1 Senior Adjunct Instructor Portland State University Maseeh College of Engineering and Computer Science Winter 2018 2

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15 600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15 25.1 Introduction Today we re going to spend some time discussing game

More information

Midterm Exam. CS381-Cryptography. October 30, 2014

Midterm Exam. CS381-Cryptography. October 30, 2014 Midterm Exam CS381-Cryptography October 30, 2014 Useful Items denotes exclusive-or, applied either to individual bits or to sequences of bits. The same operation in Python is denoted ˆ. 2 10 10 3 = 1000,

More information

lecture notes September 2, How to sort?

lecture notes September 2, How to sort? .30 lecture notes September 2, 203 How to sort? Lecturer: Michel Goemans The task of sorting. Setup Suppose we have n objects that we need to sort according to some ordering. These could be integers or

More information

Lecture 1: An Introduction to Graph Theory

Lecture 1: An Introduction to Graph Theory Introduction to Graph Theory Instructor: Padraic Bartlett Lecture 1: An Introduction to Graph Theory Week 1 Mathcamp 2011 Mathematicians like to use graphs to describe lots of different things. Groups,

More information

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal https://hal.archives-ouvertes.fr/hal

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal https://hal.archives-ouvertes.fr/hal NP versus PSPACE Frank Vega To cite this version: Frank Vega. NP versus PSPACE. Preprint submitted to Theoretical Computer Science 2015. 2015. HAL Id: hal-01196489 https://hal.archives-ouvertes.fr/hal-01196489

More information

CS125 : Introduction to Computer Science. Lecture Notes #11 Procedural Composition and Abstraction. c 2005, 2004 Jason Zych

CS125 : Introduction to Computer Science. Lecture Notes #11 Procedural Composition and Abstraction. c 2005, 2004 Jason Zych CS125 : Introduction to Computer Science Lecture Notes #11 Procedural Composition and Abstraction c 2005, 2004 Jason Zych 1 Lecture 11 : Procedural Composition and Abstraction Solving a problem...with

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined

More information

Lecture 3: Linear Classification

Lecture 3: Linear Classification Lecture 3: Linear Classification Roger Grosse 1 Introduction Last week, we saw an example of a learning task called regression. There, the goal was to predict a scalar-valued target from a set of features.

More information

Lecture 10, Zero Knowledge Proofs, Secure Computation

Lecture 10, Zero Knowledge Proofs, Secure Computation CS 4501-6501 Topics in Cryptography 30 Mar 2018 Lecture 10, Zero Knowledge Proofs, Secure Computation Lecturer: Mahmoody Scribe: Bella Vice-Van Heyde, Derrick Blakely, Bobby Andris 1 Introduction Last

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 28 Chinese Postman Problem In this lecture we study the Chinese postman

More information

CS 161 Computer Security

CS 161 Computer Security Paxson Spring 2017 CS 161 Computer Security Discussion 4 Week of February 13, 2017 Question 1 Clickjacking (5 min) Watch the following video: https://www.youtube.com/watch?v=sw8ch-m3n8m Question 2 Session

More information

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph Graphs and Trees Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) who is connected to whom Web search views web pages as a graph Who points to whom Niche graphs (Ecology):

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 23.1 Introduction We spent last week proving that for certain problems,

More information

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 397 E-mail: natarajan.meghanathan@jsums.edu Optimization vs. Decision

More information

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions. CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT

More information

8 Matroid Intersection

8 Matroid Intersection 8 Matroid Intersection 8.1 Definition and examples 8.2 Matroid Intersection Algorithm 8.1 Definitions Given two matroids M 1 = (X, I 1 ) and M 2 = (X, I 2 ) on the same set X, their intersection is M 1

More information

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT 20170926 CNF-SAT: CNF-SAT is a problem in NP, defined as follows: Let E be a Boolean expression with m clauses and n literals (literals = variables, possibly negated), in which - each clause contains only

More information

Core Membership Computation for Succinct Representations of Coalitional Games

Core Membership Computation for Succinct Representations of Coalitional Games Core Membership Computation for Succinct Representations of Coalitional Games Xi Alice Gao May 11, 2009 Abstract In this paper, I compare and contrast two formal results on the computational complexity

More information

Computational Geometry: Lecture 5

Computational Geometry: Lecture 5 Computational Geometry: Lecture 5 Don Sheehy January 29, 2010 1 Degeneracy In many of the algorithms that we have discussed so far, we have run into problems when that input is somehow troublesome. For

More information

Approximation Algorithms

Approximation Algorithms 15-251: Great Ideas in Theoretical Computer Science Spring 2019, Lecture 14 March 5, 2019 Approximation Algorithms 1 2 SAT 3SAT Clique Hamiltonian- Cycle given a Boolean formula F, is it satisfiable? same,

More information

CS 4349 Lecture October 18th, 2017

CS 4349 Lecture October 18th, 2017 CS 4349 Lecture October 18th, 2017 Main topics for #lecture include #minimum_spanning_trees. Prelude Homework 6 due today. Homework 7 due Wednesday, October 25th. Homework 7 has one normal homework problem.

More information

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W. : Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity

More information

Quality of Service (QoS) Routing. A Quick Review of NP-Completeness

Quality of Service (QoS) Routing. A Quick Review of NP-Completeness Quality of Service (QoS) Routing These slides are created by Dr. Yih Huang of George Mason University. Students registered in Dr. Huang's courses at GMU can make a single machine-readable copy and print

More information

Notebook Assignments

Notebook Assignments Notebook Assignments These six assignments are a notebook using techniques from class in the single concrete context of graph theory. This is supplemental to your usual assignments, and is designed for

More information

(Refer Slide Time: 02.06)

(Refer Slide Time: 02.06) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 27 Depth First Search (DFS) Today we are going to be talking

More information

CPSC 320: Intermediate Algorithm Design and Analysis. Tutorial: Week 3

CPSC 320: Intermediate Algorithm Design and Analysis. Tutorial: Week 3 CPSC 320: Intermediate Algorithm Design and Analysis Author: Susanne Bradley Tutorial: Week 3 At the time of this week s tutorial, we were approaching the end of our stable matching unit and about to start

More information

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0). CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find

More information

Exact Algorithms Lecture 7: FPT Hardness and the ETH

Exact Algorithms Lecture 7: FPT Hardness and the ETH Exact Algorithms Lecture 7: FPT Hardness and the ETH February 12, 2016 Lecturer: Michael Lampis 1 Reminder: FPT algorithms Definition 1. A parameterized problem is a function from (χ, k) {0, 1} N to {0,

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS276: Cryptography Handout N24 Luca Trevisan April 21, 2009 Notes for Lecture 24 Scribed by Milosh Drezgich, posted May 11, 2009 Summary Today we introduce the notion of zero knowledge proof

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

8 NP-complete problem Hard problems: demo

8 NP-complete problem Hard problems: demo Ch8 NPC Millennium Prize Problems http://en.wikipedia.org/wiki/millennium_prize_problems 8 NP-complete problem Hard problems: demo NP-hard (Non-deterministic Polynomial-time hard), in computational complexity

More information

(Refer Slide Time 5:19)

(Refer Slide Time 5:19) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology, Madras Lecture - 7 Logic Minimization using Karnaugh Maps In the last lecture we introduced

More information

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017 CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017 Reading: Section 9.2 of DPV. Section 11.3 of KT presents a different approximation algorithm for Vertex Cover. Coping

More information

Homework 2 CS161 Computer Security, Spring 2008 Assigned 2/13/08 Due 2/25/08

Homework 2 CS161 Computer Security, Spring 2008 Assigned 2/13/08 Due 2/25/08 Homework 2 CS161 Computer Security, Spring 2008 Assigned 2/13/08 Due 2/25/08 1. Signatures and Attacks Recall that to use the ElGamal signature scheme, Alice randomly selects her private signing key x

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Homework 4: Due tomorrow (March 9) at 11:59 PM Recap Linear Programming Very Powerful Technique (Subject of Entire Courses)

More information

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability Algorithm Design Patterns and Anti-Patterns CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Algorithm design patterns. Ex. Greedy. O(n log n) interval scheduling. Divide-and-conquer.

More information

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY Lecture 20: Satisfiability Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day Suppose we are given

More information

Graph Theory Part Two

Graph Theory Part Two Graph Theory Part Two Recap from Last Time A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph

More information

1 5,9,2,7,6,10,4,3,8,1 The first number (5) is automatically the first number of the sorted list

1 5,9,2,7,6,10,4,3,8,1 The first number (5) is automatically the first number of the sorted list Algorithms One of the more challenging aspects of Computer Science are algorithms. An algorithm is a plan that solves a problem. When assembling a bicycle based on the included instructions, in this case,

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Suggested Reading: Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Probabilistic Modelling and Reasoning: The Junction

More information

How invariants help writing loops Author: Sander Kooijmans Document version: 1.0

How invariants help writing loops Author: Sander Kooijmans Document version: 1.0 How invariants help writing loops Author: Sander Kooijmans Document version: 1.0 Why this document? Did you ever feel frustrated because of a nasty bug in your code? Did you spend hours looking at the

More information

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees Axiomatizing Arithmetic Logic: The Big Picture Suppose we restrict the domain to the natural numbers, and allow only the standard symbols of arithmetic (+,, =, >, 0, 1). Typical true formulas include:

More information

11.1 Facility Location

11.1 Facility Location CS787: Advanced Algorithms Scribe: Amanda Burton, Leah Kluegel Lecturer: Shuchi Chawla Topic: Facility Location ctd., Linear Programming Date: October 8, 2007 Today we conclude the discussion of local

More information

We have already seen the transportation problem and the assignment problem. Let us take the transportation problem, first.

We have already seen the transportation problem and the assignment problem. Let us take the transportation problem, first. Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 19 Network Models In this lecture, we will discuss network models. (Refer

More information

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 97 E-mail: natarajan.meghanathan@jsums.edu Optimization vs. Decision

More information

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

Why Use Graphs? Test Grade. Time Sleeping (Hrs) Time Sleeping (Hrs) Test Grade

Why Use Graphs? Test Grade. Time Sleeping (Hrs) Time Sleeping (Hrs) Test Grade Analyzing Graphs Why Use Graphs? It has once been said that a picture is worth a thousand words. This is very true in science. In science we deal with numbers, some times a great many numbers. These numbers,

More information

(Refer Slide Time 6:48)

(Refer Slide Time 6:48) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

Cypress Adopts Questa Formal Apps to Create Pristine IP

Cypress Adopts Questa Formal Apps to Create Pristine IP Cypress Adopts Questa Formal Apps to Create Pristine IP DAVID CRUTCHFIELD, SENIOR PRINCIPLE CAD ENGINEER, CYPRESS SEMICONDUCTOR Because it is time consuming and difficult to exhaustively verify our IP

More information

1 Variations of the Traveling Salesman Problem

1 Variations of the Traveling Salesman Problem Stanford University CS26: Optimization Handout 3 Luca Trevisan January, 20 Lecture 3 In which we prove the equivalence of three versions of the Traveling Salesman Problem, we provide a 2-approximate algorithm,

More information

ISA 562: Information Security, Theory and Practice. Lecture 1

ISA 562: Information Security, Theory and Practice. Lecture 1 ISA 562: Information Security, Theory and Practice Lecture 1 1 Encryption schemes 1.1 The semantics of an encryption scheme. A symmetric key encryption scheme allows two parties that share a secret key

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015

Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015 Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015 The Seven Bridges of Königsberg In

More information

Strategy. 1. You must do an internal needs analysis before looking at software or creating an ITT

Strategy. 1. You must do an internal needs analysis before looking at software or creating an ITT Strategy 1. You must do an internal needs analysis before looking at software or creating an ITT It is very easy to jump straight in and look at database software before considering what your requirements

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

Table of Laplace Transforms

Table of Laplace Transforms Table of Laplace Transforms 1 1 2 3 4, p > -1 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Heaviside Function 27 28. Dirac Delta Function 29 30. 31 32. 1 33 34. 35 36. 37 Laplace Transforms

More information

Lecture 8: The Traveling Salesman Problem

Lecture 8: The Traveling Salesman Problem Lecture 8: The Traveling Salesman Problem Let G = (V, E) be an undirected graph. A Hamiltonian cycle of G is a cycle that visits every vertex v V exactly once. Instead of Hamiltonian cycle, we sometimes

More information

Lecture 4: 3SAT and Latin Squares. 1 Partial Latin Squares Completable in Polynomial Time

Lecture 4: 3SAT and Latin Squares. 1 Partial Latin Squares Completable in Polynomial Time NP and Latin Squares Instructor: Padraic Bartlett Lecture 4: 3SAT and Latin Squares Week 4 Mathcamp 2014 This talk s focus is on the computational complexity of completing partial Latin squares. Our first

More information

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem CS61: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem Tim Roughgarden February 5, 016 1 The Traveling Salesman Problem (TSP) In this lecture we study a famous computational problem,

More information

CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness

CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness CS364A: Algorithmic Game Theory Lecture #19: Pure Nash Equilibria and PLS-Completeness Tim Roughgarden December 2, 2013 1 The Big Picture We now have an impressive list of tractability results polynomial-time

More information

Hardness of Approximation for the TSP. Michael Lampis LAMSADE Université Paris Dauphine

Hardness of Approximation for the TSP. Michael Lampis LAMSADE Université Paris Dauphine Hardness of Approximation for the TSP Michael Lampis LAMSADE Université Paris Dauphine Sep 2, 2015 Overview Hardness of Approximation What is it? How to do it? (Easy) Examples The PCP Theorem What is it?

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi. Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 18 Tries Today we are going to be talking about another data

More information

Animations involving numbers

Animations involving numbers 136 Chapter 8 Animations involving numbers 8.1 Model and view The examples of Chapter 6 all compute the next picture in the animation from the previous picture. This turns out to be a rather restrictive

More information

Figure 1: A directed graph.

Figure 1: A directed graph. 1 Graphs A graph is a data structure that expresses relationships between objects. The objects are called nodes and the relationships are called edges. For example, social networks can be represented as

More information

Lecture 14: Linear Programming II

Lecture 14: Linear Programming II A Theorist s Toolkit (CMU 18-859T, Fall 013) Lecture 14: Linear Programming II October 3, 013 Lecturer: Ryan O Donnell Scribe: Stylianos Despotakis 1 Introduction At a big conference in Wisconsin in 1948

More information

Ma/CS 6a Class 27: Shortest Paths

Ma/CS 6a Class 27: Shortest Paths // Ma/CS a Class 7: Shortest Paths By Adam Sheffer Naïve Path Planning Problem. We are given a map with cities and noncrossing roads between pairs of cities. Describe an algorithm for finding a path between

More information

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises... Modules 6 Hamilton Graphs (4-8 lectures) 135 6.1 Introduction................................ 136 6.2 Necessary conditions and sufficient conditions............. 137 Exercises..................................

More information

Introduction to Algorithms

Introduction to Algorithms Introduction to Algorithms 6.046J/18.401 Lecture 21 Prof. Piotr Indyk P vs NP (interconnectedness of all things) A whole course by itself We ll do just two lectures More in 6.045, 6.840J, etc. Introduction

More information

1 Achieving IND-CPA security

1 Achieving IND-CPA security ISA 562: Information Security, Theory and Practice Lecture 2 1 Achieving IND-CPA security 1.1 Pseudorandom numbers, and stateful encryption As we saw last time, the OTP is perfectly secure, but it forces

More information

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

CPSC 536N: Randomized Algorithms Term 2. Lecture 10 CPSC 536N: Randomized Algorithms 011-1 Term Prof. Nick Harvey Lecture 10 University of British Columbia In the first lecture we discussed the Max Cut problem, which is NP-complete, and we presented a very

More information