Advanced Topics NP-complete reports. Continue on NP, parallelism.

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Introduction to Approximation Algorithms Lecture 12: Mar 1.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Semidefinite Programming
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Chapter 11: Limitations of Algorithmic Power
Homework 2 In the docs folder of your Berkeley DB, have a careful look at documentation on how to configure BDB in main memory. In the docs folder of your.
1 Internet Networking Spring 2002 Tutorial 6 Network Cost of Minimum Spanning Tree.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
NP and NP- Completeness Bryan Pearsaul. Outline Decision and Optimization Problems Decision and Optimization Problems P and NP P and NP Polynomial-Time.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
Advanced Topics: MapReduce ECE 454 Computer Systems Programming Topics: Reductions Implemented in Distributed Frameworks Distributed Key-Value Stores Hadoop.
Introduction to Parallel Programming MapReduce Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under.
By: Jeffrey Dean & Sanjay Ghemawat Presented by: Warunika Ranaweera Supervised by: Dr. Nalin Ranasinghe.
Programming & Data Structures
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
1 The Map-Reduce Framework Compiled by Mark Silberstein, using slides from Dan Weld’s class at U. Washington, Yaniv Carmeli and some other.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
MapReduce Kristof Bamps Wouter Deroey. Outline Problem overview MapReduce o overview o implementation o refinements o conclusion.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Unit 9: Coping with NP-Completeness
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
NP-Complete Problems Algorithm : Design & Analysis [23]
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Optimization Problems
“One ring to rule them all” Analogy (sort of) Lord of The Rings Computational Complexity “One problem to solve them all” “my preciousss…”
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
P, NP, and NP-Complete Problems Section 10.3 The class P consists of all problems that can be solved in polynomial time, O(N k ), by deterministic computers.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Hongyu Liang Institute for Theoretical Computer Science Tsinghua University, Beijing, China The Algorithmic Complexity.
Construction We constructed the following graph: This graph has several nice properties: Diameter Two Graph Pebbling Tim Lewis 1, Dan Simpson 1, Sam Taggart.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
CSCI1600: Embedded and Real Time Software
Analysis and design of algorithm
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
CSCI1600: Embedded and Real Time Software
MapReduce: Simplified Data Processing on Large Clusters
Presentation transcript:

Advanced Topics NP-complete reports. Continue on NP, parallelism

Reprise: Non-determinism Informal: add to any algorithm –taking a guess at one or more places –forking and pursuing one or more possibilities If there is a Non-deterministic algorithm, then there is a regular/standard algorithm –just try all the possibilities –may take a long time

Reprise: the class P … is all problems for which there exist an algorithm with complexity bounded by a polynomial.

Reprise: the class NP all problems for which there is an algorithm, possibly non-deterministic, that assuming you take the right paths, is bounded by a polynomial Alternative definition: you can check that the answer is correct in polynomial time.

Reprise: does P = NP? Is it possible to find actual standard algorithms for these NP problems? THE great problem of computer science. Proving it false would also be significant. Theoretical problem with considerable practical value.

NP complete A set of NP problems that can be translated into each other in polynomial time so… If one of the problems can be solved in polynomial time –aka tractible …. they all can.

NP-hard A problem is NP-hard if there is an NP- complete problem that can be translated into it in polynomial time. –but not necessarily the other way. NP-hard problems are at least as hard as NP-complete problems.

NP-hard example Robot path planning in a dynamic environment

Reports on NP-complete problems Tetris Knapsack problem Steiner Tree problem Graph coloring Minesweeper Subset problem

Note There are methods for getting answers to NP problems, but they aren't guaranteed to be optimal. Called heuristics or approximations

Distributed computing Approach to NP problems: fork a new process That is, use distributed computing to investigate the different choices Some problems may be embarrassingly parallelizable.

Sources Many Google: duce-tutorial.html duce-tutorial.html Note: there is controversy re: MapReduce –may be issue of patent –Is it the right framework –??

Concepts key/value pair Master / Worker nodes on network –may be one Master and many Workers hashing: quick way to find data (key/value data) piece / partition / split / shard

Example from Google tutorial Compute pi using many workers, each doing a calculation using pseudo-random function. –no data (NOT typical MapReduce problem) Worker picks a random point in the square. If it is in the circle, worker increments a counter. processing/piEstimate/applet/ processing/piEstimate/applet/

Formulas Area_of_circle = pi * r2 Area_of_square containing circle = 4 * r2 So r2 = Area_of_square / 4 Let Ac be Area_of_circle and As be Area_of_square Then pi = 4 * Ac / As Estimate for pi is 4 * counter / Number_of_points_tried

Informal proof The chances of any point being in the circle is proportional to the ratio of the areas. Choosing many points randomly carries out this test. We could [simply] use for-loops and do the calculation for every point.

MapReduce Model for distributed (aka parallel) computing There are different products that implement MapReduce. From a google search: –Google –Apache Hadoop: Open source –Teradata –Amazon –Greenplum –Platform

MapReduce Programmers sets up program for Master and for Workers. Typically, the Master program sets up and partitions input array(s). Typically, data is key/value pairs. Programmers write –Map functions that process data, possibly making use of functions in the MapReduce library –Reduce functions that combine the results Workers work on Map tasks and/or Reduce tasks. The Map task is applied to the worker's piece (aka shard) of the input array.

MapReduce for pi estimate Not typical in that there is no data The map function does the calculation When all done, the reduce function adds up all the individual counters and calculates the estimate for pi

Speed up for pi estimate Suppose –each step (getting the 2 random values and determining if in circle) takes K steps –suppose 1000 workers calculating all together values –suppose adding 2 numbers takes 1 time unit Time without distributed computing: *K Time with distributed computing 1000*K Speed up is slightly less than 1000

Follow-up Look up examples using MapReduce Note: one example is Google maintaining its keyword index by scanning (crawling) the web

Speaker IBM Smarter Cities Social media for political campaigns World Community Grid

Homework Prepare question for Kevin –follow on twitter and send message OR –post on moodle Continue with postings Research unique NP complete problem and post summary and source!