Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover

Similar documents
Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

Network Flows: Introduction & Maximum Flow

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

1 Motivation and Basic Definitions

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

Main Reference: Sections in CLRS.

Today: Max Flow Proofs

Soviet Rail Network, 1955

Matching. Slides designed by Kevin Wayne.

Maximum Flow and Minimum Cut

Randomized Perfect Bipartite Matching

Algorithm Design and Analysis

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

Algorithm Design and Analysis

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

18 Extensions of Maximum Flow

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

Algorithmic Discrete Mathematics 6. Exercise Sheet

Graphs III - Network Flow

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

Soviet Rail Network, 1955

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem.

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

CSE 521: Design & Analysis of Algorithms I

Maximum Flow in Planar Graphs

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

Network Flow. Data Structures and Algorithms Andrei Bulatov

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

16 Max-Flow Algorithms and Applications

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

Introduction to Congestion Games

EECE 301 Signals & Systems Prof. Mark Fowler

Network Flows UPCOPENCOURSEWARE number 34414

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

Reminder: Flow Networks

They were originally developed for network problem [Dantzig, Ford, Fulkerson 1956]

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

Maximum Flow. Contents. Max Flow Network. Maximum Flow and Minimum Cut

Selfish Routing. Tim Roughgarden Cornell University. Includes joint work with Éva Tardos

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

To become more mathematically correct, Circuit equations are Algebraic Differential equations. from KVL, KCL from the constitutive relationship

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2

Maximum Flow. How do we transport the maximum amount data from source to sink? Some of these slides are adapted from Lecture Notes of Kevin Wayne.

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University

6.8 Laplace Transform: General Formulas

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

3/3/2015. Chapter 7. Network Flow. Maximum Flow and Minimum Cut. Minimum Cut Problem

u(t) Figure 1. Open loop control system

Average Case Lower Bounds for Monotone Switching Networks

23 Maximum Flows and Minimum Cuts

Algorithms. Algorithms 6.4 MAXIMUM FLOW

CMPS 6610/4610 Fall Flow Networks. Carola Wenk Slides adapted from slides by Charles Leiserson

Network Flow Applications

26.1 Flow networks. f (u,v) = 0.

Graph Theory: Network Flow

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

CHAPTER 7: SECOND-ORDER CIRCUITS

6.302 Feedback Systems Recitation : Phase-locked Loops Prof. Joel L. Dawson

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Laplace Transform. Inverse Laplace Transform. e st f(t)dt. (2)

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

Price of Stability and Introduction to Mechanism Design

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Chapter 6. Laplace Transforms

Notes for Lecture 17-18

Computer-Aided Analysis of Electronic Circuits Course Notes 3

Maximum Flow 5/6/17 21:08. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Chapter 7: Inverse-Response Systems

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

Exponential Sawtooth

20/20 20/20 0/5 0/5 20/20 20/20 5/5 0/5 0/5 5/5 0/20 25/30 20/20 30/30 20/20 0/5 5/5 20/20 0/5 0/5 15/20 15/25 20/20 10/10

arxiv: v1 [cs.cg] 21 Mar 2013

Journal of Discrete Algorithms. Approximability of partitioning graphs with supply and demand

Some Ramsey results for the n-cube

Linear Response Theory: The connection between QFT and experiments

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

Chapter 6. Laplace Transforms

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

ARTIFICIAL INTELLIGENCE. Markov decision processes

Introduction to SLE Lecture Notes

Sample Final Exam (finals03) Covering Chapters 1-9 of Fundamentals of Signals & Systems

Let. x y. denote a bivariate time series with zero mean.

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0

Topics in Combinatorial Optimization May 11, Lecture 22

Guest Lectures for Dr. MacFarlane s EE3350 Part Deux

Chapter 7: Solving Trig Equations

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

Lecture 26. Lucas and Stokey: Optimal Monetary and Fiscal Policy in an Economy without Capital (JME 1983) t t

Homework sheet Exercises done during the lecture of March 12, 2014

Physics 240: Worksheet 16 Name

Diebold, Chapter 7. Francis X. Diebold, Elements of Forecasting, 4th Edition (Mason, Ohio: Cengage Learning, 2006). Chapter 7. Characterizing Cycles

Transcription:

Pleae Complee Coure Survey CMPSCI : Inroducion o Algorihm Dealing wih NP-Compleene Dan Sheldon hp: //owl.oi.uma.edu/parner/coureevalsurvey/uma/ Univeriy of Maachue Slide Adaped from Kevin Wayne La Compiled: May, 207 Coping Wih NP-Compleene Approximaion Algorihm Suppoe you wan o olve an NP-complee problem? Wha hould you do? You can deign an algorihm o do all of he following:. Solve arbirary inance of he problem 2. Solve problem o opimaliy. Solve problem in polynomial ime Coping raegie. Deign algorihm for pecial cae of problem. Independen e in pah, ree. 2. Deign approximaion algorihm or heuriic. Today.. Deign algorihm ha may ake exponenial ime. No oday. ρ-approximaion algorihm Run in polynomial ime Solve arbirary inance of he problem Guaraneed o find a oluion wihin raio ρ of rue opimum Greedy Verex Cover Here i a 2-approximaion for Verex Cover: Pick an arbirary edge Take boh endpoin Delee all covered edge and repea Analyi Reul i a verex cover, oherwie here i an edge remaining Final reul correpond o a maching: no wo edge hare an endpoin. Suppoe he maching ha k edge. Then any cover ha ize a lea k, becaue i mu elec a lea one endpoin of every edge in he maching The eleced cover ha ize 2k a mo wice he ize of he opimal Knapack Problem n iem, weigh w i, value v i, oal capaciy W Goal: maximize oal value wihou exceeding capaciy iem value weigh 2 6 2 8 22 6 28 7 Knapack i NP-complee: Sube-Sum P Knapack We already aw a O(nW ) dynamic programming algorihm

Knapack Problem Dynamic Programming v2 Knapack Problem Approximaion Algorihm Definiion. OPT(i, v) = min weigh of a knapack for which we can obain a oluion of value v uing a ube of iem,..., i OPT(i, v) = min { OPT(i, v), w i + OPT(i, v v i ) } OPT(i, v) = 0 if v 0 OPT(0, v) = if v > 0 Running ime i O(nV ) where V i an upper bound on oal value, e.g. V = nv max No polynomial in inpu ize Polynomial if value are mall ineger Idea: round all value (up) o coarer uni and run dynamic programming algorihm iem value weigh 9,22 2,96,2 2 7,80,0 2,27,800 6 27,7,8 7 iem value weigh 2 6 2 8 22 6 28 7 The reul will never exceed he weigh capaciy, bu may loe ome value due o rounding error. Rounding Deail Analyi Le S = rounded DP oluion, S = opimal oluion We ll how ha S ge nearly a much value a S : Round o neare muliple of θ: v i = original value.,96,2 vi v i = θ = rounded value. 6,000,000 θ vi = value acually ued in DP. 6 θ v i v i i S i S v i i S round up S opimal for rounded value i S(v i + θ) rounding amoun θ i S v i + nθ ( + ɛ) i S v i The la inequaliy i rue if nθ ɛ i S v i. Se θ = ɛv max /n. Running Time A Real-World Applicaion Recall θ = ɛv max /n. Value of a ingle iem in rounded DP i: vi nvi = n θ ɛv max ɛ V = n 2 /ɛ i an upper bound on oal value Running ime i O(nV ) = O(n /ɛ) Theorem: For any ɛ > 0, he rounding algorihm compue a oluion whoe value i wihin a ( + ɛ) facor of he opimum in O(n /ɛ) ime. Fir, an exenion o he Knapack problem Suppoe here are k differen acion available for each iem (e.g., ype of repair o apply o infrarucure elemen) wij = co of acion j for iem i vij = value of acion j for iem i Sill O(nV ) OPT(i, v) = min j { wij + OPT(i, v v ij ) }

A Real-World Applicaion A Real-World Applicaion Now, uppoe he iem value are no independen, bu ordered from o n uch ha he value from {,..., i} depend on value from {,..., i } and acion aken a i OPT(i, v) = min j { wij + OPT(i, f ij (v)) } f ij (v) = value needed from {,..., i } o realize v uni of value, auming acion j aken, e.g.: wij = cah fee for invemen ype j fij (v) = aring accoun value needed o ge balance of v dollar in nex ime ep if ake acion j Sill O(nV ) Inerpreaion: OPT(i, v) = ROI curve. Can be exended furher, o cae where here i a rooed ree on iem Le T i be ubree rooed a i val(t i ) depend on {val(t l ) : l i a child of i}, acion a i Barrier-removal in river nework. Summary Topic Polynomial-ime reducion NP-compleene Nework flow Dynamic programming Divide-and-conquer MST Greedy Graph algorihm and definiion Aympoic analyi Polynomial Time Reducion We focu on deciion problem, e.g., for inpu (G, k), he queion i doe here exi a verex cover wih a mo k node. Given wo deciion problem X and Y, X P Y mean ha i poible o ranform an inpu I of X ino an inpu f(i) of Y in polynomial ime uch ha I i a ye inance of X iff f(i) i a ye inance of Y The ranformaion i a reducion from X o Y. We aw example uch a VerexCover P IndependenSe -SAT P IndependenSe Ueful propery: If X P Y and Y P Z hen X P Z. NP Compleene P = e of problem you can olve in polynomial ime, e.g., minimum panning ree, maching, flow, hore pah. NP = e of problem you can verify in he polynomial ime: If he anwer hould be ye hen here ome exra inpu (a wine or cerificae or hin ) ha you can be given ha make i eay (i.e., in poly ime) o check anwer i ye If he anwer hould be no" hen here doen uch an inpu. Y i NP -Complee if Y NP and X P Y X NP. Ueful Properie: Suppoe X P Y. Then If Y P hen X P. If Y NP and X i NP-complee hen Y i alo NP complee If Y P and X i NP-complee hen P = NP. NP -Complee problem are in ome ene he harde problem in NP. If you can olve one of hem in polynomial ime hen you prove P = NP. Bu very few people believe hi i poible. Nework Flow Flow nework Flow Direced graph Source node and arge node Edge capaciie c(e) 0 Capaciy Conrain: 0 f(e) c(e) on each edge Flow conervaion: for all v / {, }, f(e) = f(e) e ino v e ou of v Value v(f) of flow f = oal flow on edge leaving ource Max flow problem: find a flow of maximum value Reidual nework encode how you can change he curren flow wihou violaing he capaciy conrain. Ford Fulkeron Algorihm: Repeaedly increae he flow by finding augmening pah in he reidual nework.

Augmen Example Augmening Pah /6 2/2 /20 /6 2/2 /20 G / /9 7/7 G / /9 7/7 8/ / 8/ / / / 2 2 G f 7 G f 7 8 8 New Flow Max-Flow Min-Cu Theorem /6 2/2 9/20 G / 0/9 7/7 v(f) c(a, B) for any flow f and any - cu c(a, B) 2/ / 2 / 9 Upon erminaion, Ford-Fulkeron produce a flow f and cu (A, B) uch ha v(f) = c(a, B), o f i a max-flow and (A, B) i a min-cu The cu (A, B) i found by leing A = e of node reachable from in reidual graph G f 9 7 2 Dynamic Programming Deign echnique baed on recurion. Idenify recurive rucure by wriing recurrence for opimal value. The recurrence idenifie all ubproblem. Solve hem in a yemaic way aring from imple one fir (bae cae) Example: Weighed inerval cheduling OPT(j) = max{opt(j ), w j + OPT(p(j))} OPT(0) = 0 Compue OPT(j) ieraively for j = 0 o n Running ime O(n) Divide-And-Conquer Deign echnique: Ofen: divide inpu ino equal ized chunk, olve each recurively, combine o olve original problem Can be more uble e.g., ineger muliplicaion Tip: don hink abou wha happen inide recurion. Magic Solving recurrence, e.g., T (n) 2T (n/2) + O(n) Recurion ree, unrolling Gue and verify : proof by inducion Maer heorem Suppoe T (n) = at (n/b) + O(n d ). Then: O(n d ) if d > log b a T (n) = O(n d log n) if d = log b a O(n log b a ) if d < log b a

MST Greedy Algorihm Definiion: panning ree, MST, cu Cu propery: lighe edge acro any cu belong o every MST Prim algorihm: mainain a e S of explored node. Add cheape edge from S o V S. Repea. Krukal algorihm: conider edge in order of co. Add edge if i doe no creae a cycle. Greedy algorihm are hor ighed" algorihm ha ake each ep baed on wha look good in he hor erm. Example: Krukal Algorihm add lighe edge ha doen complee a cycle when building an MST. Example: When maximizing he number of non-overlapping TV how we alway added he how ha finihed earlie ou of he remaining how. Greedy Algorihm Thing o noe: If a greedy algorihm require fir oring he inpu, remember o include he running ime of oring in your overall analyi. Focu on correcne proof: greedy ay ahead, exchange argumen, inducion, conradicion Wha o know: Apply/adap proof echnique for cheduling problem; olve imilar problem Working knowledge of MST algorihm, Dijkra: apply o concree example, underand principle and proof echnique Relaed Traveral Algorihm Graph Algorihm: BFS and DFS Tree BFS from node : Pariion node ino layer L0 = {}, L, L 2, L... Li defined a neighbor of node in L i ha aren already in L 0 L... L i. Li i e of node a diance exacly i from Reurn ree T : for any edge (u, v) in graph, u and v are in ame layer or adjacen layer Can be ued o e wheher G i biparie, find hore pah from o DFS from node Reurn DFS ree T rooed a For any edge (u, v), u i an anceor of v in he ree or vice vera. Boh run in ime O(m + n) Boh can be ued o find conneced componen of graph, e wheher here i a pah from o Biparie, Direced Graph Algorihm ha grow a e S of explored node from aring node BFS (raveral): add all node v ha are neighbor of ome node u S. Repea. Dijkra (hore pah): add node v wih malle value of d(u) + l(u, v) for ome node u in S, where d(u) i diance from o u. Repea. Prim (MST): add node v wih malle value of c(u, v) where u S. Repea. An undireced graph G i biparie if i node can be colored red and blue uch ha no edge ha wo endpoin of he ame color G i biparie if and only if i doe no conain an odd cycle G i biparie if and only if, afer running BFS from any node, here i no edge beween wo node in he ame layer A direced graph i acyclic (a DAG) if here i no direced cycle There i no direced cycle if and only if here i a opological ordering. Can find a opological order uing he fac ha a DAG ha a node wih no incoming edge.

Aympoic Analyi Given wo poiive funcion f(n) and g(n): f(n) i O(g(n)) if any only if c 0, n0 0.. f(n) cg(n) for all n n 0 f(n) i Ω(g(n)) if and only if c 0, n0 0.. f(n) cg(n) for all n n 0 if and only if g(n) i O(f(n)) f(n) i Θ(g(n)) if and only if f(n) i O(g(n)) and f(n) i Ω(g(n)) Know how o apply definiion, compare funcion, ue o analyze running ime of algorihm