Algorithm Design and Analysis

Similar documents
Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

11. APPROXIMATION ALGORITHMS

Applied Algorithm Design Lecture 5

Approximation Algorithms

Scheduling Shop Scheduling. Tim Nieberg

Guessing Game: NP-Complete?

Topic: Greedy Approximations: Set Cover and Min Makespan Date: 1/30/06

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

5.1 Bipartite Matching

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Distributed Computing over Communication Networks: Maximal Independent Set

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Classification - Examples

Single machine parallel batch scheduling with unbounded capacity

Triangle deletion. Ernie Croot. February 3, 2010

CSC2420 Spring 2015: Lecture 3

THE PROBLEM WORMS (1) WORMS (2) THE PROBLEM OF WORM PROPAGATION/PREVENTION THE MINIMUM VERTEX COVER PROBLEM

Discuss the size of the instance for the minimum spanning tree problem.

Why? A central concept in Computer Science. Algorithms are ubiquitous.

ONLINE DEGREE-BOUNDED STEINER NETWORK DESIGN. Sina Dehghani Saeed Seddighin Ali Shafahi Fall 2015

8.1 Min Degree Spanning Tree

Duplicating and its Applications in Batch Scheduling

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

Small Maximal Independent Sets and Faster Exact Graph Coloring

Lecture 7: NP-Complete Problems

Proximal mapping via network optimization

CSC 373: Algorithm Design and Analysis Lecture 16

Problem Set 7 Solutions

1 Approximating Set Cover

Approximability of Two-Machine No-Wait Flowshop Scheduling with Availability Constraints

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

Fairness in Routing and Load Balancing

Combinatorial Algorithms for Data Migration to Minimize Average Completion Time

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Introduction to Scheduling Theory

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Tutorial 8. NP-Complete Problems

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams

Near Optimal Solutions

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

Definition Given a graph G on n vertices, we define the following quantities:

Load Balancing. Load Balancing 1 / 24

Improved Algorithms for Data Migration

Approximated Distributed Minimum Vertex Cover Algorithms for Bounded Degree Graphs

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Minimizing the Number of Machines in a Unit-Time Scheduling Problem

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

Approximating Minimum Bounded Degree Spanning Trees to within One of Optimal

School Timetabling in Theory and Practice

Transportation Polytopes: a Twenty year Update

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

Social Media Mining. Graph Essentials

Scheduling to Minimize Power Consumption using Submodular Functions

The Goldberg Rao Algorithm for the Maximum Flow Problem

Weighted Sum Coloring in Batch Scheduling of Conflicting Jobs

Private Approximation of Clustering and Vertex Cover

. P. 4.3 Basic feasible solutions and vertices of polyhedra. x 1. x 2

Introduction to Logic in Computer Science: Autumn 2006

An Approximation Algorithm for Bounded Degree Deletion

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma

A Approximation Algorithm for a Generalization of the Weighted Edge-Dominating Set Problem

Adaptive Linear Programming Decoding

Max Flow, Min Cut, and Matchings (Solution)

ARTICLE IN PRESS. European Journal of Operational Research xxx (2004) xxx xxx. Discrete Optimization. Nan Kong, Andrew J.

CMPSCI611: Approximating MAX-CUT Lecture 20

Algorithms and Data Structures

The Generalized Assignment Problem with Minimum Quantities

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

On the Unique Games Conjecture

Online Adwords Allocation

Steiner Tree Approximation via IRR. Randomized Rounding

Common Approaches to Real-Time Scheduling

ON THE COMPLEXITY OF THE GAME OF SET.

THE SCHEDULING OF MAINTENANCE SERVICE

9th Max-Planck Advanced Course on the Foundations of Computer Science (ADFOCS) Primal-Dual Algorithms for Online Optimization: Lecture 1

Solutions to Homework 6

MapReduce and Distributed Data Analysis. Sergei Vassilvitskii Google Research

Nan Kong, Andrew J. Schaefer. Department of Industrial Engineering, Univeristy of Pittsburgh, PA 15261, USA

Optimal Monitoring in Multi-Channel Multi-Radio Wireless Mesh Networks

Online Scheduling with Bounded Migration

Transcription:

Algorithm Design and Analysis LECTURE 27 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/6/2011 S. Raskhodnikova; based on slides by E. Demaine, C. Leiserson, A. Smith, K. Wayne

11.1 Load Balancing

Load Balancing Input. m identical machines; n jobs, job j has processing time t j. Job j must run contiguously on one machine. A machine can process at most one job at a time. Def. Let J(i) be the subset of jobs assigned to machine i. The load of machine i is L i = j J(i) t j. Def. The makespan is the maximum load on any machine L = max i L i. Load balancing. Assign each job to a machine to minimize makespan. Hardness. Load Balancing is NP-complete even for 2 machines. Exercise. Prove this statement. Hint: to prove NP-hardness, reduce from Number Partitioning. Today: approximation algorithms for Load Balalncing. 3

Load Balancing: List Scheduling List-scheduling algorithm. Consider n jobs in some fixed order. Assign job j to machine whose load is smallest so far. List-Scheduling(m, n, t 1,t 2,,t n ) { for i = 1 to m { L i 0 load on machine i J(i) jobs assigned to machine i } } for j = 1 to n { i = argmin k L k J(i) J(i) {j} L i L i + t j } return J machine i has smallest load assign job j to machine i update load of machine i Implementation. O(n log n) using a priority queue. 4

Load Balancing: List Scheduling Analysis Theorem. [Graham, 1966] Greedy algorithm is a 2-approximation. First worst-case analysis of an approximation algorithm. Need to compare resulting solution with optimal makespan L*. Lemma 1. The optimal makespan L* max j t j. Pf. Some machine must process the most time-consuming job. Lemma 2. The optimal makespan Pf. The total processing time is j t j. L * m 1 j t j. One of m machines must do at least a 1/m fraction of total work. 5

Load Balancing: List Scheduling Analysis Theorem. Greedy algorithm is a 2-approximation. Pf. Consider load L i of bottleneck machine i. Let j be last job scheduled on machine i. When job j assigned to machine i, i had smallest load. Its load before assignment is L i - t j L i - t j L k for all 1 k m. blue jobs scheduled before j machine i j 0 L i - t j L = L i 6

Load Balancing: List Scheduling Analysis Theorem. Greedy algorithm is a 2-approximation. Pf. Consider load L i of bottleneck machine i. Let j be last job scheduled on machine i. When job j assigned to machine i, i had smallest load. Its load before assignment is L i - t j L i - t j L k for all 1 k m. Sum inequalities over all k and divide by m: Now L i (L i t j ) t j 2L *. L* Lemma 1 L i t j m 1 k L k 1 m k t k L * L* Lemma 2 7

Load Balancing: List Scheduling Analysis Q. Is our analysis tight? A. Essentially yes. Ex: m machines, m(m-1) jobs length 1 jobs, one job of length m machine 2 idle machine 3 idle machine 4 idle m = 10 machine 5 idle machine 6 idle machine 7 idle machine 8 idle machine 9 idle machine 10 idle list scheduling makespan = 19 8

Load Balancing: List Scheduling Analysis Q. Is our analysis tight? A. Essentially yes. Ex: m machines, m(m-1) jobs length 1 jobs, one job of length m m = 10 optimal makespan = 10 9

Load Balancing: LPT Rule Longest processing time (LPT). Sort n jobs in descending order of processing time, and then run list scheduling algorithm. LPT-List-Scheduling(m, n, t 1,t 2,,t n ) { Sort jobs so that t 1 t 2 t n for i = 1 to m { L i 0 J(i) } load on machine i jobs assigned to machine i } for j = 1 to n { i = argmin k L k J(i) J(i) {j} L i L i + t j } return J machine i has smallest load assign job j to machine i update load of machine i 10

Load Balancing: LPT Rule Observation. If at most m jobs, then list-scheduling is optimal. Pf. Each job put on its own machine. Lemma 3. If there are more than m jobs, L* 2 t m+1. Pf. Consider first m+1 jobs t 1,, t m+1. Since the t i 's are in descending order, each takes at least t m+1 time. There are m+1 jobs and m machines, so by pigeonhole principle, at least one machine gets two jobs. Theorem. LPT rule is a 3/2 approximation algorithm. Pf. Same basic approach as for list scheduling. L i (L i t j ) L* t j 3 L *. 2 1 L* 2 Lemma 3 ( by observation, can assume number of jobs > m ) 11

Load Balancing: LPT Rule Q. Is our 3/2 analysis tight? A. No. Theorem. [Graham, 1969] LPT rule is a 4/3-approximation. Pf. More sophisticated analysis of same algorithm. Q. Is Graham's 4/3 analysis tight? A. Essentially yes. Ex: m machines, n = 2m+1 jobs, 2 jobs of length m+1, m+2,, 2m-1 and one job of length m. Exercise: Understand why. 12

Load Balancing: State of the Art Polynomial Time Approximation Scheme (PTAS). (1 + )-approximation algorithm for any constant > 0. [Hochbaum-Shmoys 1987] Consequence. PTAS produces arbitrarily high quality solution, but trades off accuracy for time.

11.4 The Pricing Method: Vertex Cover

Weighted Vertex Cover Weighted vertex cover. Given a graph G with vertex weights, find a vertex cover of minimum weight. 2 4 2 4 2 9 2 9 weight = 2 + 2 + 4 weight = 2+9=11 15

Weighted Vertex Cover Pricing method. Each edge must be covered by some vertex. Edge e pays price p e 0 to get covered. Fairness. Edges incident to vertex i should pay w i in total. 2 0 4 for each vertex i : e ( i, j) p e w i 1 1 4 2 1 9 Fairness Lemma. For any vertex cover S and any fair prices p e : e p e w(s). Proof. ee p e is e( i, j) p e is w i w( S). each edge e covered by at least one node in S sum fairness inequalities for each node in S 16

Big Ideas Push prices up Start with all prices set to 0 Increase gradually Maintain fairness: for each vertex i : A vertex v becomes tight when sum of prices equals weight: e ( i, j) p e w i e(i, j ) p e w i At the end of the algorithm, tight vertices form a vertex cover within a factor 2 of optimal How do we increase weights? Find some edge for which neither end is tight Increase as much as you can

Pricing Method: Example price of edge a-b vertex weight Figure 11.8

Pricing Method: Algorithm Pricing method. Set prices and find vertex cover simultaneously. Weighted-Vertex-Cover-Approx(G=(V,E), w) { foreach e in E p e 0 foreach v in V total v 0 total i = w i while ( edge (i,j) such that neither i nor j is tight) select such an edge e \\give p e maximum increase without violating fairness increase max(w i -total i,w j -total j ) p e p e + increase total i total i + increase total j total j + increase } S set of all tight nodes return S

Pricing Method: Analysis Theorem. Pricing method gives a 2-approximation. Pf. Algorithm terminates since at least one new node becomes tight after each iteration of while loop. Let S = set of all tight nodes upon termination of algorithm. S is a vertex cover: if some edge i-j is uncovered, then neither i nor j is tight. But then while loop would not terminate. Let S* be an optimal vertex cover. We show w(s) 2w(S*). w(s) w i i S i S p e e(i,j) iv p e e(i,j) 2 p e 2w(S*). e E fairness lemma all nodes in S are tight S V, each edge counted twice prices 0 Running time: O(m).

11.6 LP Rounding: Vertex Cover

Weighted Vertex Cover: IP Formulation Weighted vertex cover. Given an undirected graph G = (V, E) with vertex weights w i 0, find a minimum weight subset of nodes S such that every edge is incident to at least one vertex in S. Integer programming formulation. Model inclusion of each vertex i using a 0/1 variable x i. x i 0 if vertex i is not in vertex cover 1 if vertex i is in vertex cover Vertex covers in 1-1 correspondence with 0/1 assignments: S = {i V : x i = 1} Objective function: minimize i w i x i. Constraints for each edge (i,j): must take either i or j: x i + x j 1. 22

Weighted Vertex Cover: IP Formulation Weighted vertex cover. Integer programming formulation. (ILP) min w i x i i V s. t. x i x j 1 (i, j) E x i {0,1} i V Observation. If x* is optimal solution to (ILP), then S = {i V : x* i = 1} is a min weight vertex cover. 23

Weighted Vertex Cover: LP Relaxation Weighted vertex cover. Linear programming formulation. (LP) min w i x i i V s. t. x i x j 1 (i, j) E x i 0 i V Observation. Optimal value of (LP) is optimal value of (ILP). Pf. LP has fewer constraints. Note. LP is not equivalent to vertex cover. ½ ½ Q. How can solving LP help us find a small vertex cover? A. Solve LP and round fractional values. ½ 24

Weighted Vertex Cover Theorem. If x* is optimal solution to (LP), then S = {i V : x* i ½} is a vertex cover whose weight is at most twice the min possible weight. Pf. [S is a vertex cover] Consider an edge (i, j) E. Since x* i + x* j 1, either x* i ½ or x* j ½ (i, j) covered. Pf. [S has desired cost] Let S* be optimal vertex cover. Then w i i S* * w i x i 1 w 2 i i S i S LP is a relaxation x* i ½ 25

Weighted Vertex Cover Theorem. 2-approximation algorithm for weighted vertex cover. Theorem. [Dinur-Safra 2001] If P NP, then no -approximation for < 1.3607, even with unit weights. 10 5-21 Open research problem. Close the gap. 26