Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover

Similar documents
10. EXTENDING TRACTABILITY

Examples and applications on SSSP and MST

Analysis of Algorithms - Elementary graphs algorithms -

Homework #3. 1 x. dx. It therefore follows that a sum of the

Analysis of Algorithms - Elementary graphs algorithms -

Basic Polyhedral theory

Week 3: Connected Subgraphs

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

The Equitable Dominating Graph

cycle that does not cross any edges (including its own), then it has at least

SOME PARAMETERS ON EQUITABLE COLORING OF PRISM AND CIRCULANT GRAPH.

Combinatorial Networks Week 1, March 11-12

CS 491 G Combinatorial Optimization

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall

Thickness and Colorability of Geometric Graphs

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

First derivative analysis

CS553 Lecture Register Allocation I 3

1 Minimum Cut Problem

4.5 Minimum Spanning Tree. Chapter 4. Greedy Algorithms. Minimum Spanning Tree. Motivating application

Minimum Spanning Trees

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

Strongly Connected Components

UNTYPED LAMBDA CALCULUS (II)

CS 580: Algorithm Design and Analysis

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

4.5 Minimum Spanning Tree. Chapter 4. Greedy Algorithms. Minimum Spanning Tree. Applications

priority queue ADT heaps 1

ANALYSIS IN THE FREQUENCY DOMAIN

3) Use the average steady-state equation to determine the dose. Note that only 100 mg tablets of aminophylline are available here.

CSI35 Chapter 11 Review

Derangements and Applications

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM

On the irreducibility of some polynomials in two variables

MSLC Math 151 WI09 Exam 2 Review Solutions

LR(0) Analysis. LR(0) Analysis

Superposition. Thinning

On spanning trees and cycles of multicolored point sets with few intersections

First order differential equation Linear equation; Method of integrating factors

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

Coupled Pendulums. Two normal modes.

PROBLEM SET Problem 1.

Computing and Communications -- Network Coding

Where k is either given or determined from the data and c is an arbitrary constant.

Solutions to Homework 5

The Matrix Exponential

64. A Conic Section from Five Elements.

EXST Regression Techniques Page 1

Square of Hamilton cycle in a random graph

Addition of angular momentum

SCHUR S THEOREM REU SUMMER 2005

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

Figure 1: Closed surface, surface with boundary, or not a surface?

Higher order derivatives

The Matrix Exponential

From Elimination to Belief Propagation

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Hardy-Littlewood Conjecture and Exceptional real Zero. JinHua Fei. ChangLing Company of Electronic Technology Baoji Shannxi P.R.

Abstract Interpretation: concrete and abstract semantics

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES. 1. Statement of results

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

Kernels. ffl A kernel K is a function of two objects, for example, two sentence/tree pairs (x1; y1) and (x2; y2)

Addition of angular momentum

Quasi-Classical States of the Simple Harmonic Oscillator

Weak Unit Disk and Interval Representation of Graphs

(Upside-Down o Direct Rotation) β - Numbers

Bifurcation Theory. , a stationary point, depends on the value of α. At certain values

Chapter 10. The singular integral Introducing S(n) and J(n)

Supplementary Materials

a g f 8 e 11 Also: Minimum degree, maximum degree, vertex of degree d 1 adjacent to vertex of degree d 2,...

Basic Logic Review. Rules. Lecture Roadmap Combinational Logic. Textbook References. Basic Logic Gates (2-input versions)

Finding low cost TSP and 2-matching solutions using certain half integer subtour vertices

Deift/Zhou Steepest descent, Part I

y = 2xe x + x 2 e x at (0, 3). solution: Since y is implicitly related to x we have to use implicit differentiation: 3 6y = 0 y = 1 2 x ln(b) ln(b)

Random Access Techniques: ALOHA (cont.)

A Propagating Wave Packet Group Velocity Dispersion

General Caching Is Hard: Even with Small Pages

Final Exam Solutions

Text: WMM, Chapter 5. Sections , ,

ON RIGHT(LEFT) DUO PO-SEMIGROUPS. S. K. Lee and K. Y. Park

Linked-List Implementation. Linked-lists for two sets. Multiple Operations. UNION Implementation. An Application of Disjoint-Set 1/9/2014

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

EEO 401 Digital Signal Processing Prof. Mark Fowler

Random Process Part 1

Differentiation of Exponential Functions

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

Multiple Short Term Infusion Homework # 5 PHA 5127

Solution of Assignment #2

Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem.

International Journal of Scientific & Engineering Research, Volume 6, Issue 7, July ISSN

Indeterminate Forms and L Hôpital s Rule. Indeterminate Forms

MATHEMATICS (B) 2 log (D) ( 1) = where z =

The graph of y = x (or y = ) consists of two branches, As x 0, y + ; as x 0, y +. x = 0 is the

Mathematics 1110H Calculus I: Limits, derivatives, and Integrals Trent University, Summer 2018 Solutions to the Actual Final Examination

Economics 201b Spring 2010 Solutions to Problem Set 3 John Zhu

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

Transcription:

Coping With NP-Compltnss Chaptr 0 Extning th Limits o Tractability Q. Suppos I n to solv an NP-complt problm. What shoul I o? A. Thory says you'r unlikly to in poly-tim algorithm. Must sacriic on o thr sir aturs. Solv problm to optimality. Solv problm in polynomial tim. Solv arbitrary instancs o th problm. This lctur. Solv som spcial cass o NP-complt problms that aris in practic. Slis by Kvin Wayn. Copyright @ 00 Parson-Aison Wsly. All rights rsrv. Vrtx Covr 0. Fining Small Vrtx Covrs VERTEX COVER: Givn a graph G = (V, E) an an intgr k, is thr a subst o vrtics S V such that S k, an or ach g (u, v) ithr u S, or v S, or both. 6 7 8 k = S = {, 6, 7, 0 9 0

Fining Small Vrtx Covrs Fining Small Vrtx Covrs Q. What i k is small? Brut orc. O(k nk+ ). Try all C(n, k) = O(n k ) substs o siz k. Taks O(k n) tim to chck whthr a subst is a vrtx covr. Goal. Limit xponntial pnncy on k,.g., to O( k k n). Ex. n =,000, k = 0. Brut. k nk+ = 0 inasibl. Bttr. k k n = 07 asibl. Rmark. I k is a constant, algorithm is poly-tim; i k is a small constant, thn it's also practical. Claim. Lt u-v b an g o G. G has a vrtx covr o siz k i at last on o G { u an G { v has a vrtx covr o siz k-. P. Suppos G has a vrtx covr S o siz k. S contains ithr u or v (or both). Assum it contains u. S { u is a vrtx covr o G { u. lt v an all incint gs P. Suppos S is a vrtx covr o G { u o siz k-. Thn S { u is a vrtx covr o G. Claim. I G has a vrtx covr o siz k, it has k(n-) gs. P. Each vrtx covrs at most n- gs. 6 Fining Small Vrtx Covrs: Algorithm Fining Small Vrtx Covrs: Rcursion Tr Claim. Th ollowing algorithm trmins i G has a vrtx covr o siz k in O( k kn) tim. boolan Vrtx-Covr(G, k) { i (G contains no gs) rturn tru i (G contains kn gs) rturn als lt (u, v) b any g o G a = Vrtx-Covr(G - {u, k-) b = Vrtx-Covr(G - {v, k-) rturn a or b $ c i k = 0 & T(n, k) " % cn i k = & ' T(n,k #)+ ckn i k > k k- ( T(n, k) " k ck n k- P. Corrctnss ollows rom prvious two claims. Thr ar k+ nos in th rcursion tr; ach invocation taks O(kn) tim. k- k- k - i k- k- 0 0 0 0 0 0 0 0 7 8

Inpnnt St on Trs 0. Solving NP-Har Problms on Trs Inpnnt st on trs. Givn a tr, in a maximum carinality subst o nos such that no two shar an g. Fact. A tr on at last two nos has at last two la nos. gr = Ky obsrvation. I v is a la, thr xists a maximum siz inpnnt st containing v. u P. (xchang argumnt) Consir a max carinality inpnnt st S. I v S, w'r on. I u S an v S, thn S { v is inpnnt S not maximum. IF u S an v S, thn S { v { u is inpnnt. v 0 Inpnnt St on Trs: Gry Algorithm Wight Inpnnt St on Trs Thorm. Th ollowing gry algorithm ins a maximum carinality inpnnt st in orsts (an hnc trs). Inpnnt-St-In-A-Forst(F) { S φ whil (F has at last on g) { Lt = (u, v) b an g such that v is a la A v to S Dlt rom F nos u an v, an all gs incint to thm. rturn S P. Corrctnss ollows rom th prvious ky obsrvation. Rmark. Can implmnt in O(n) tim by consiring nos in postorr. Wight inpnnt st on trs. Givn a tr an no wights w v > 0, in an inpnnt st S that maximizs Σ v S w v. Obsrvation. I (u, v) is an g such that v is a la no, thn ithr OPT inclus u, or it inclus all la nos incint to u. Dynamic programming solution. Root tr at som no, say r. OPT in (u) = max wight inpnnt st o subtr root at u, containing u. OPT out (u) = max wight inpnnt st o subtr root at u, not containing u. OPT in (u) = w u + # OPT out (v) v " chilrn(u) OPT out (u) = # max { OPT in (v), OPT out (v) v " chilrn(u) v r u w x chilrn(u) = { v, w, x

Wight Inpnnt St on Trs: Dynamic Programming Algorithm Contxt Thorm. Th ynamic programming algorithm ins a maximum wight inpnnt st in a tr in O(n) tim. Wight-Inpnnt-St-In-A-Tr(T) { Root th tr at a no r orach (no u o T in postorr) { i (u is a la) { M in [u] = w u M out [u] = 0 ls { M in [u] = w u + Σ v chilrn(u) M out [v] M out [u] = Σ v chilrn(u) max(m in [v], M out [v]) rturn max(m in [r], M out [r]) nsurs a no is visit atr all its chilrn P. Taks O(n) tim sinc w visit nos in postorr an xamin ach g xactly onc. can also in inpnnt st itsl (not just valu) Inpnnt st on trs. This structur spcial cas is tractabl bcaus w can in a no that braks th communication among th subproblms in irnt subtrs. u s Chaptr 0., but proc with caution Graphs o boun tr with. Elgant gnralization o trs that: Capturs a rich class o graphs that aris in practic. Enabls composition into inpnnt pics. u Wavlngth-Division Multiplxing 0. Circular Arc Coloring Wavlngth-ivision multiplxing (WDM). Allows m communication strams (arcs) to shar a portion o a ibr optic cabl, provi thy ar transmitt using irnt wavlngths. Ring topology. Spcial cas is whn ntwork is a cycl on n nos. Ba nws. NP-complt, vn on rings. Brut orc. Can trmin i k colors suic in O(k m ) tim by trying all k-colorings. c b a Goal. O((k)) poly(m, n) on rings. n =, m = 6 6

Wavlngth-Division Multiplxing Rviw: Intrval Coloring Wavlngth-ivision multiplxing (WDM). Allows m communication strams (arcs) to shar a portion o a ibr optic cabl, provi thy ar transmitt using irnt wavlngths. Intrval coloring. Gry algorithm ins coloring such that numbr o colors quals pth o schul. maximum numbr o strams at on location Ring topology. Spcial cas is whn ntwork is a cycl on n nos. c j Ba nws. NP-complt, vn on rings. a b g h i Brut orc. Can trmin i k colors suic in O(k m ) tim by trying all k-colorings. Goal. O((k)) poly(m, n) on rings. c b a Circular arc coloring. Wak uality: numbr o colors pth. Strong uality os not hol. n =, m = 6 max pth = min colors = 7 8 (Almost) Transorming Circular Arc Coloring to Intrval Coloring Circular Arc Coloring: Dynamic Programming Algorithm Circular arc coloring. Givn a st o n arcs with pth k, can th arcs b color with k colors? Equivalnt problm. Cut th ntwork btwn nos v an v n. Th arcs can b color with k colors i th intrvals can b color with k colors in such a way that "slic" arcs hav th sam color. Dynamic programming algorithm. Assign istinct color to ach intrval which bgins at cut no v 0. At ach no v i, som intrvals may inish, an othrs may bgin. Enumrat all k-colorings o th intrvals through v i that ar consistnt with th colorings o th intrvals through v i-. Th arcs ar k-colorabl i som coloring o intrvals ning at cut no v 0 is consistnt with original coloring o th sam intrvals. ys v 0 v colors o a', b', an c' must corrspon to colors o a", b", an c" c' b' b' a" b" v v a' c" c" v v 0 v v v v v 0 v 0 v v v v v 0 9 0

Circular Arc Coloring: Running Tim Running tim. O(k! n). n phass o th algorithm. Bottlnck in ach phas is numrating all consistnt colorings. Thr ar at most k intrvals through v i, so thr ar at most k! colorings to consir. Extra Slis Rmark. This algorithm is practical or small valus o k (say k = 0) vn i th numbr o nos n (or paths) is larg. Vrtx Covr Vrtx Covr in Bipartit Graphs Vrtx covr. Givn an unirct graph G = (V, E), a vrtx covr is a subst o vrtics S V such that or ach g (u, v) E, ithr u S or v S or both. ' ' ' S = {,,, ', ' S = ' '

Vrtx Covr Vrtx Covr: König-Egrváry Thorm Wak uality. Lt M b a matching, an lt S b a vrtx covr. Thn, M S. König-Egrváry Thorm. In a bipartit graph, th max carinality o a matching is qual to th min carinality o a vrtx covr. P. Each vrtx can covr at most on g in any matching. ' ' S* = {, ', ', ' S* = ' ' ' M = -', -', -' M = ' M* = -', -', -', -' M* = ' ' ' ' 6 Vrtx Covr: Proo o König-Egrváry Thorm Vrtx Covr: Proo o König-Egrváry Thorm König-Egrváry Thorm. In a bipartit graph, th max carinality o a matching is qual to th min carinality o a vrtx covr. Suics to in matching M an covr S such that M = S. Formulat max low problm as or bipartit matching. Lt M b max carinality matching an lt (A, B) b min cut. König-Egrváry Thorm. In a bipartit graph, th max carinality o a matching is qual to th min carinality o a vrtx covr. Suics to in matching M an covr S such that M = S. Formulat max low problm as or bipartit matching. Lt M b max carinality matching an lt (A, B) b min cut. Din L A = L A, L B = L B, R A = R A, R B = R B. ' Claim. S = L B R A is a vrtx covr. consir (u, v) E ' u L A, v R B impossibl sinc ininit capacity thus, ithr u L B or v R A or both s ' t Claim. S = M. max-low min-cut thorm M = cap(a, B) ' only gs o orm (s, u) or (v, t) contribut to cap(a, B) M = cap(a, B) = L B + R A = S. ' 7 8

Rgistr Allocation Rgistr Allocation Rgistr. On o k o high-sp mmory locations in computr's CPU. say Rgistr allocator. Part o an optimizing compilr that controls which variabls ar sav in th rgistrs as compil program xcuts. variabls or tmporaris Intrrnc graph. Nos ar "liv rangs." Eg u-v i thr xists an opration whr both u an v ar "liv" at th sam tim. Obsrvation. [Chaitin, 98] Can solv rgistr allocation problm i intrrnc graph is k-colorabl. Spilling. I graph is not k-colorabl (or w can't in a k-coloring), w "spill" crtain variabls to main mmory an swap back as n. typically inrquntly us variabls that ar not in innr loops 0 A Usul Proprty Chaitin's Algorithm Rmark. Rgistr allocation problm is NP-har. Ky act. I a no v in graph G has wr than k nighbors, G is k-colorabl i G { v is k-colorabl. lt v an all incint gs P. Dlt no v rom G an color G { v. I G { v is not k-colorabl, thn nithr is G. I G { v is k-colorabl, thn thr is at last on rmaining color lt or v. Vrtx-Color(G, k) { say, no with wst nighbors whil (G is not mpty) { Pick a no v with wr than k nighbors Push v on stack Dlt v an all its incint gs whil (stack is not mpty) { Pop nxt no v rom th stack Assign v a color irnt rom its nighboring nos which hav alray bn color v k = k = G is -colorabl vn though all nos hav gr

Chaitin's Algorithm Thorm. [Kmp 879, Chaitin 98] Chaitin's algorithm proucs a k-coloring o any graph with max gr k-. P. Follows rom ky act sinc ach no has wr than k nighbors. algorithm succs in k-coloring many graphs with max gr k Rmark. I algorithm nvr ncountrs a graph whr all nos hav gr k, thn it proucs a k-coloring. Practic. Chaitin's algorithm (an variants) ar xtrmly ctiv an wily us in ral compilrs or rgistr allocation.