Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time

Similar documents
Part I: Graph Coloring

CSC 373: Algorithm Design and Analysis Lecture 17

Post-Routing Layer Assignment for Double Patterning

Lecture 3: Nondeterministic Computation

CSE 101. Algorithm Design and Analysis Miles Jones Office 4208 CSE Building Lecture 9: Greedy

ORF 307: Lecture 14. Linear Programming: Chapter 14: Network Flows: Algorithms

Restricted super line signed graph RL r (S)

ORF 307 Network Flows: Algorithms

Note on Path Signed Graphs

Total Minimal Dominating Signed Graph

Route optimization using Hungarian method combined with Dijkstra's in home health care services

MVP: Capture-Power Reduction with Minimum-Violations Partitioning for Delay Testing

Negation Switching Equivalence in Signed Graphs

Problem 1 - Protoss. bul. Alexander Malinov 33., Sofia, 1729, Bulgaria academy.telerik.com

Signed Graph Equation L K (S) S

1/ 19 2/17 3/23 4/23 5/18 Total/100. Please do not write in the spaces above.

Iterative Deletion Routing Algorithm

Logic Design II (17.342) Spring Lecture Outline

Power-Driven Flip-Flop p Merging and Relocation. Shao-Huan Wang Yu-Yi Liang Tien-Yu Kuo Wai-Kei Tsing Hua University

THE COMMON MINIMAL COMMON NEIGHBORHOOD DOMINATING SIGNED GRAPHS. Communicated by Alireza Abdollahi. 1. Introduction

Interconnect Planning with Local Area Constrained Retiming

The PeRIPLO Propositional Interpolator

Chapter 5 Synchronous Sequential Logic

Beyond Worst Case Analysis in Approxima4on Uriel Feige The Weizmann Ins2tute

CPSC 121: Models of Computation. Module 1: Propositional Logic

More design examples, state assignment and reduction. Page 1

Math Final Exam Practice Test December 2, 2013

OPERATIONS SEQUENCING IN A CABLE ASSEMBLY SHOP

Cascading Citation Indexing in Action *

Heuristic Search & Local Search

Mathematics, Proofs and Computation

Design for Test. Design for test (DFT) refers to those design techniques that make test generation and test application cost-effective.

Flip-Flop Insertion with Shifted-Phase Clocks for FPGA Power Reduction

Scrambling and Descrambling SMT-LIB Benchmarks

Design Example: Demo Display Unit

MULTI-CYCLE AT SPEED TEST. A Thesis MALLIKA SHREE POKHAREL

On the Infinity of Primes of the Form 2x 2 1

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

General Certificate of Education Advanced Subsidiary Examination June Problem Solving, Programming, Data Representation and Practical Exercise

PLANE TESSELATION WITH MUSICAL-SCALE TILES AND BIDIMENSIONAL AUTOMATIC COMPOSITION

Accelerating Smart Play-Out

Latch-Based Performance Optimization for FPGAs. Xiao Teng

Designing the US Incentive Auction

Lossless Compression Algorithms for Direct- Write Lithography Systems

White Paper. Performance analysis: DOCSIS 3.1 cable TV headend combining systems

B291B. MATHEMATICS B (MEI) Paper 1 Section B (Foundation Tier) GENERAL CERTIFICATE OF SECONDARY EDUCATION. Friday 9 January 2009 Morning

Homework Packet Week #5 All problems with answers or work are examples.

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS150, Spring 2011

Melodic Pattern Segmentation of Polyphonic Music as a Set Partitioning Problem

Australian Journal of Basic and Applied Sciences. Design of SRAM using Multibit Flipflop with Clock Gating Technique

Lecture 7. Scope and Anaphora. October 27, 2008 Hana Filip 1

VLSI Design: 3) Explain the various MOSFET Capacitances & their significance. 4) Draw a CMOS Inverter. Explain its transfer characteristics

mcs 2015/5/18 1:43 page 15 #23

Yale University Department of Computer Science

Understanding IP Video for

Predicting the immediate future with Recurrent Neural Networks: Pre-training and Applications

A Fast Constant Coefficient Multiplier for the XC6200

Fast Mode Decision Algorithm for Intra prediction in H.264/AVC Video Coding

Digital Principles and Design

Hardware Implementation of Viterbi Decoder for Wireless Applications

Real-Time Systems Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Selective Intra Prediction Mode Decision for H.264/AVC Encoders

Finding Patterns with a Rotten Core: Data Mining for Crime Series with Cores

1) What is the standard divisor? A) 30.1 B) 903 C) 6.38 D) 6.88 E) 16.74

VirtualSync: Timing Optimization by Synchronizing Logic Waves with Sequential and Combinational Components as Delay Units

ORTHOGONAL frequency division multiplexing

Optimization of Multi-Channel BCH Error Decoding for Common Cases. Russell Dill Master's Thesis Defense April 20, 2015

Module 8 VIDEO CODING STANDARDS. Version 2 ECE IIT, Kharagpur

Chapter 12. Synchronous Circuits. Contents

Layout-Aware Scan Chain Synthesis for Improved Path Delay Fault Coverage

Digital Logic Design ENEE x. Lecture 19

INFORMATION SYSTEMS. Written examination. Wednesday 12 November 2003

Informatique Fondamentale IMA S8

DIMACS Implementation Challenges 1 Network Flows and Matching, Clique, Coloring, and Satisability, Parallel Computing on Trees and

Mining Complex Boolean Expressions for Sequential Equivalence Checking

Making the circular self-test path technique effective for real circuits

140 IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, VOL. 12, NO. 2, FEBRUARY 2004

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Evaluation of Serial Periodic, Multi-Variable Data Visualizations

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Sample manuscript showing style and formatting specifications for SPIE e-journal papers

Lecture 1: Introduction & Image and Video Coding Techniques (I)

Permutations of the Octagon: An Aesthetic-Mathematical Dialectic

Test Data Compression for System-on-a-Chip Using Golomb Codes 1

EE 109 Homework 6 State Machine Design Name: Score:

An Experimental Comparison of Fast Algorithms for Drawing General Large Graphs

Unit 2: Graphing Part 5: Standard Form

Computation before computer science (pre 1960): visions and visionaries

Using Scan Side Channel to Detect IP Theft

Design of Fault Coverage Test Pattern Generator Using LFSR

BIG SYNTHETIC DATA WITH MUSKETEER

SPM Training Manual Veeco Bioscope II NIFTI-NUANCE Center Northwestern University

TL-2900 AMMONIA & NITRATE ANALYZER DUAL CHANNEL

DIFFERENTIATE SOMETHING AT THE VERY BEGINNING THE COURSE I'LL ADD YOU QUESTIONS USING THEM. BUT PARTICULAR QUESTIONS AS YOU'LL SEE

FORMAL METHODS INTRODUCTION

MC9211 Computer Organization

Investigation on Technical Feasibility of Stronger RS FEC for 400GbE

Maintenance/ Discontinued

Asynchronous IC Interconnect Network Design and Implementation Using a Standard ASIC Flow

Area-efficient high-throughput parallel scramblers using generalized algorithms

Transcription:

Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time

Last week: Defined Polynomial Time Reductions: Problem X is poly time reducible to Y X P Y if can solve X using poly computation and a poly number of calls to an algorithm solving Y. Up to poly factors, X is at least as easy as Y Up to poly factors, Y is harder than X

Last class: Defined NP: decision (yes/no) problems can check certificates for yes answers in ptime Have poly time proof checkers: A poly time algorithm A so that if X(s) = yes, there exists a w so that A(s,w) = yes, and if X(s) = no, for all w, A(s,w) = no

Last class: Defined NP-Complete: 1. X NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y NP, Y P X, or 2. CircuitSat P X, or 3. Y P X, for some NP-Hard Y, such as SAT, Independent Set, Vertex Cover

Last class: Proved CircuitSAT is NP-Hard. Proved CircuitSAT P SAT. In fact, proved CircuitSAT P 3-SAT Where 3-SAT is SAT, but each clause has at most 3 terms.

Last class: Proved CircuitSAT is NP-Hard. Proved CircuitSAT P SAT. In fact, proved CircuitSAT P 3-SAT Where 3-SAT is SAT, but each clause has at most 3 terms. Also possible to force each variable to appear at most 3 times

Also possible to force each variable to appear at most 3 times Say a variable x appears k times. Create k new variables, x 1,, x k, one for each occurrence. Add clauses x 1 V x 2, x 2 V x 3,, x k-1 V x k, x k V x 1 Only satisfied if all are equal.

Today Will prove more problems are NP-complete: 3-coloring Hamiltonian Cycle Travelling Salesman Problem

k-coloring Given a graph G = (V,E), does there exist f : V {1,2,, k} (colors) So that for all (u,v) E f(u) = f(v)? 3-colorable Not 3-colorable

k-coloring Given a graph G = (V,E), does there exist f : V {1,2,, k} (colors) So that for all (u,v) E f(u) = f(v)? 3-colorable Not 3-colorable

k-coloring is NP-Complete Clearly in NP, because can check a proposed coloring To prove NP-hard, will show 3-SAT P 3-Coloring Given a collection of clauses C 1,, C k, each with at most 3 terms, on variables x 1,, x n produce graph G = (V,E) that is 3-colorable iff the clauses are satisfiable

3-Coloring is NP-Complete variable gadgets Create 3 special nodes: T, F, B (base), and one node for each term: x i and x i T F B x 1 x 1 x 2 x 2 x n x n In every 3-coloring, one of x i and x i is colored T and one is colored F

3-Coloring is NP-Complete variable gadgets Create 3 special nodes: T, F, B (base), and one node for each term: x i and x i T F B x 1 x 1 x 2 x 2 x n x n In every 3-coloring, one of x i and x i is colored T and one is colored F

3-Coloring is NP-Complete clause gadgets Consider clause x 1 V x 2 V x n B x 1 x 2 x n T Claim: 3-colorable iff terms colored to satisfy clause

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 1. If terms all colored F, then cannot 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 1. If terms all colored F, then cannot 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 1. If terms all colored F, then cannot 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 2. If some term true, can 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 2. If some term true, can 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete clause gadgets Claim: 3-colorable iff terms colored to satisfy clause 2. If some term true, can 3-color B x 1 x 2 x n T

3-Coloring is NP-Complete T B F 3-colorable iff satisfiable x 1 x 1 x 2 x 2 x 3 x 3 x n x n x 1 V x 2 V x n

3-Coloring is NP-Complete T B F 3-colorable iff satisfiable x 1 x 1 x 2 x 2 x 3 x 3 x n x n x 1 V x 2 V x n x 2 V x 3 V x n

Hamiltonian Cycle: A cycle in a graph that hits each vertex once. Directed Hamiltonian Cycle: same, but in a directed graph

Directed Ham Cycle is NP-Complete Clearly in NP, because can check if a cycle is Hamiltonian To prove NP-hard, will show 3-SAT P Directed Ham Cycle Produce directed graph G = (V,E) that has Ham Cycle iff the clauses are satisfiable

Start: create graph with 2 n Ham Cycles, then create gadgets to restrict them 1: 2: 3: n:

Start: create graph with 2 n Ham Cycles, then create gadgets to restrict them 1: 2: 3: n:

Start: create graph with 2 n Ham Cycles, then create gadgets to restrict them 1: 2: 3: s n: t Must go top-to-bottom, and can traverse each row left-to-right (True) or right-to-left (False)

Start: create graph with 2 n Ham Cycles, then create gadgets to restrict them 1: 2: 3: s n: t Must go top-to-bottom, and can traverse each row left-to-right (True) or right-to-left (False)

Clause gadgets True False clause x 1 forces traverse first row 1: 2: 3: n: s t

Clause gadgets True False clause x 1 V x 2 V x n 1: 2: 3: n: s t Forces traverse 1, or 2, or n

Clause gadgets True False clause x 1 V x 2 V x n 2: To see must come back to same row, note that if do not is no hamiltonian path through unused down-link

Clause gadgets True False clause x 1 V x 2 V x n 1: 2: n: Forces traverse 1, or 2, or n

Ham cycle iff satisfiable True False x 1 V x 2 V x n Pf. If satisfiable, traverse in order indicated by vars, picking up each clause once using some true term. 1: 2: 3: n: s t

Ham cycle iff satisfiable True False x 1 V x 2 V x n Pf. If Ham Cycle, must go top to bottom 1: 2: 3: s n: assign vars by direction t if visit each clause node, then is made true by term on row from which make the visit.

Directed Ham Cycle P Ham Cycle 1. In directed problem, answer same if reverse all arrows. 2. To transform to undirected, replace each vertex v with three vertices: v in, v base, v out u v Replace directed (u,v) edge with (u out, v in ) u in u b u out v in v b v out

Directed Ham Cycle P Ham Cycle u in u b u out Claim: If these are only edges to u b, then in every Hamiltonian cycle u b must be adjacent to u in Proof: if it is not, then once enter u b can not get out

Directed Ham Cycle P Ham Cycle Replace directed (u,v) edge with (u out, v in ) u v u in u b u out v in v b v out w w in w b w out Directed Ham Cycle in original -> Ham Cycle

Directed Ham Cycle P Ham Cycle Replace directed (u,v) edge with (u out, v in ) u v u in u b u out v in v b v out w w in w b w out Lemma: Every Ham Cycle in the undirected graph must go in, base, out, in, base, out, in, base, out, etc, must correspond to a Ham Cyc in directed graph

TSP (Travelling Salesperson Problem) Given n locations, a distance function d(u,v) and a total distance D, does there exist a tour through all locations of total distance at most L? http://www.tsp.gatech.edu/usa13509/usa13509_info.html

TSP (Travelling Salesperson Problem) Given n locations, a distance function d(u,v) and a total distance D, does there exist a tour through all locations of total distance at most L? http://www.tsp.gatech.edu/usa13509/usa13509_sol.html

RL5915 optimal solution An optimal solution for RL5915 is given by the following tour, which has length 565530. http://www.tsp.gatech.edu/rl5915/rl5915_sol.html

TSP is NP-complete Ham Cycle P TSP Given graph G = (V,E), create one location for each vertex, d(u,v) = 1 if (u,v) E 2 otherwise Target distance = V A tour of all locations that returns to start and has total length V must use exactly V edges of G

TSP is NP-complete Ham Cycle P TSP Given graph G = (V,E), create one location for each vertex, d(u,v) = 1 if (u,v) E 2 otherwise This is an abstract distance function.

TSP is NP-complete Ham Cycle P TSP Given graph G = (V,E), create one location for each vertex, d(u,v) = 1 if (u,v) E 2 otherwise This is an abstract distance function. Remains NP-hard for integer points in plane.

Issue with Planar TSP If input is locations of points, instead of distances The problem is not known to be in NP, because do not know if can compare distances in polynomial time. For integers x 1,, x n integer t, do not have poly time algorithm to test if X p xi apple t i