Answers to some of the exercises.

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.

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

CMPSCI611: Approximating MAX-CUT Lecture 20

Approximation Algorithms

Handout #Ch7 San Skulrattanakulchai Gustavus Adolphus College Dec 6, Chapter 7: Digraphs

Single machine parallel batch scheduling with unbounded capacity

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

Applied Algorithm Design Lecture 5

11. APPROXIMATION ALGORITHMS

Algorithm Design and Analysis

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

TU e. Advanced Algorithms: experimentation project. The problem: load balancing with bounded look-ahead. Input: integer m 2: number of machines

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

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

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

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

Near Optimal Solutions

CAD Algorithms. P and NP

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Scheduling Shop Scheduling. Tim Nieberg

8.1 Min Degree Spanning Tree

Lecture 7: NP-Complete Problems

Graph Theory Problems and Solutions

GRAPH THEORY LECTURE 4: TREES

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

Network File Storage with Graceful Performance Degradation

The Goldberg Rao Algorithm for the Maximum Flow Problem

Introduction to Algorithms. Part 3: P, NP Hard Problems

Classification - Examples

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

Minimum cost maximum flow, Minimum cost circulation, Cost/Capacity scaling

Lecture 6 Online and streaming algorithms for clustering

Triangle deletion. Ernie Croot. February 3, 2010

Data Structures and Algorithms Written Examination

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

Problem Set 7 Solutions

Lecture 4 Online and streaming algorithms for clustering

Planar Graphs. Complement to Chapter 2, The Villas of the Bellevue

Introduction to Scheduling Theory

SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

Fairness in Routing and Load Balancing

Tutorial 8. NP-Complete Problems

CSC 373: Algorithm Design and Analysis Lecture 16

Arrangements And Duality

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

NP-Completeness and Cook s Theorem

Chapter 6: Graph Theory

Polytope Examples (PolyComp Fukuda) Matching Polytope 1

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

Stationary random graphs on Z with prescribed iid degrees and finite mean connections

One last point: we started off this book by introducing another famously hard search problem:

Midterm Practice Problems

Approximated Distributed Minimum Vertex Cover Algorithms for Bounded Degree Graphs

Guessing Game: NP-Complete?

Introduction to computer science

5.1 Bipartite Matching

14.1 Rent-or-buy problem

MATHEMATICAL ENGINEERING TECHNICAL REPORTS. An Improved Approximation Algorithm for the Traveling Tournament Problem

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Introduction to Logic in Computer Science: Autumn 2006

CK-12 Geometry: Parts of Circles and Tangent Lines

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

Private Approximation of Clustering and Vertex Cover

Shortest Inspection-Path. Queries in Simple Polygons

An Approximation Algorithm for the Unconstrained Traveling Tournament Problem

COMBINATORIAL PROPERTIES OF THE HIGMAN-SIMS GRAPH. 1. Introduction

Universality in the theory of algorithms and computer science

Network Design with Coverage Costs

Full and Complete Binary Trees

On the independence number of graphs with maximum degree 3

Just the Factors, Ma am

Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Lecture 1: Course overview, circuits, and formulas

Notes on NP Completeness

Examination paper for MA0301 Elementær diskret matematikk

Decision Mathematics D1 Advanced/Advanced Subsidiary. Tuesday 5 June 2007 Afternoon Time: 1 hour 30 minutes

Offline sorting buffers on Line

Graphical degree sequences and realizations

Collinear Points in Permutations

Extremal Wiener Index of Trees with All Degrees Odd

INDISTINGUISHABILITY OF ABSOLUTELY CONTINUOUS AND SINGULAR DISTRIBUTIONS

On the k-path cover problem for cacti

Labeling outerplanar graphs with maximum degree three

MATHEMATICS Unit Decision 1

Max Flow, Min Cut, and Matchings (Solution)

(67902) Topics in Theory and Complexity Nov 2, Lecture 7

A 2-factor in which each cycle has long length in claw-free graphs

Shortcut sets for plane Euclidean networks (Extended abstract) 1

OHJ-2306 Introduction to Theoretical Computer Science, Fall

How To Solve A Minimum Set Covering Problem (Mcp)

136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

1 if 1 x 0 1 if 0 x 1

CoNP and Function Problems

Transcription:

Answers to some of the exercises. Chapter 2. Ex.2.1 (a) There are several ways to do this. Here is one possibility. The idea is to apply the k-center algorithm first to D and then for each center in D to choose its nearest supplier. First some notation. Let OP T be the optimal value. For any d i D let f i F be its nearest supplier. (If there are more nearest suppliers then select any of these as f i.) Clearly, we must have dist(d i, f i ) OP T for any i. If D k then taking S = {f i d i D} gives an optimal solution. So from now assume that D > k. Algorithm : Apply the k-center algorithm to the set D of customers. This gives a set D = {d 1, d 2,..., d k } D of k customers. Take S = {f i d i D } as solution. We prove that this gives a 3-approximation. Consider an arbitrary customer v D. If there is a customer d i D at distance at most 2Opt from v, then by the triangle inequality dist(v, f i ) dist(v, d i ) + dist(d i, f i ) 2Opt + Opt = 3Opt. Now assume there is no customer d i D at distance at most 2Opt from v. Then, by construction of the algorithm, for any two customers in d i, d j D we have dist(d i, d j ) > 2Opt. But then the set D {v} consists of k+1 customers such that any pair is at distance strictly more then 2Opt. This is impossible since in that case at least k + 1 suppliers are needed for a solution with value Opt. (b) The idea is to adjust the proof that was given for the k-center problem (see book Theorem 2.4). We reduce from the Dominating Set problem. First we define the reduction and then we prove that it is correct. Given an instance G = (V, E) of the dominating set problem we define an instance of the k- suppliers problem as follows. For each v V there is a customer d v and supplier f v. (See Figure 1.) That means, we have V customers and V suppliers in total. Now we define all distances. Let dist(f v, f w ) = dist(d v, d w ) = 2 for each pair v, w V. Let dist(d v, f w ) = 1 if v = w or if (v, w) E and let it be 3 otherwise. It is easy to see that the triangle inequality is satisfied. Note that any solution for this instance of the k-suppliers problem has value either 1 or 3. Assume that there is a dominating set S of size k. Now take as solution for the k suppliers instance exactly the suppliers that correspond with the vertices in S. Then, the value of this solution is 1. For the other direction, assume that there is a solution for the k suppliers instance of value 1. Then take as dominating set S the vertices that correspond with the k suppliers. This is a dominating set. We showed that there is a dominating set of size k if and only if the optimal value of the corresponding k suppliers instance is 1. Now, since the optimal value is either 1 or 3 this also gives us the lower bound of 3 on the approximation ratio. This works as follows. Assume we have an α-approximation algorithm Alg for the k-suppliers problem with α < 3. We shall prove that we can use such an algorithm to solve the dominating set problem. Assume we are given an instance G, k of the dominat- 1

Figure 1: The reduction of Exercise 2.1(b). ing set problem. That means, we want to compute if there exists a dominating set with at most k vertices. Now we reduce it to the instance of the k-suppliers problem as defined above and we apply the α-approximation algorithm. If there is a dominating set of value at most k then, as argued above, the optimal value of the k-suppliers instance is 1 (Opt k =1) and the answer given by the algorithm will be at most α 1 < 3. If, on the other hand, there is no dominating set of value at most k then the optimal value of the k-suppliers instance is 3 and the answer given by the algorithm will be (at least) 3. Therefore, by looking at the output of the algorithm we know if there is a dominating set of size at most k. However, we know that there is no polynomial time algorithm that solves the dominating set problem, assuming that P N P. We conclude that no α-approximation algorithm with α < 3 exists, assuming that P N P. Opt DS k Opt k = 1 Alg αopt k < 3 Alg = 1. Opt DS > k Opt k = 3 Alg = 3. Ex. 2.2 Let n be the number of jobs. Since p j Opt/3 for each job, there are at most two jobs on each machine in the optimal schedule. First we prove that in the LPT-schedule there are also at most two jobs per machine. Assume that LPT schedules three or more jobs on some machine i. Then the start time of the last job on machine i is larger than 2Opt/3. But then, any machine must have a load strictly larger than 2Opt/3 since otherwise LPT would have scheduled the last job of machine i on a different machine. Let k be the number machines in the LPT schedule with exactly one job. Then the number of jobs is n k + (m k 1)2 + 3 = 2m k + 1. On the other hand, these k jobs have a processing time more than 2Opt/3 as argued, and are therefore also each scheduled alone on some machine in the optimal schedule. From this we conclude that the number of jobs is n k + 2(m k) = 2m k. A contradiction! We conclude that LPT schedules at most two jobs per machine. Let p 1 p 2 p n. If n m then LPT schedules at most one job per machine and this is optimal. Now assume that n = 2m k and 0 k m 1. In an optimal schedule exactly k machines process a single job and m k machines receive two jobs. Clearly, it is optimal to schedule the longest k jobs each on its own machine. For the other jobs it is optimal to make pairs (k + 1, n), (k + 2, n 1),..., (m, m + 1) and this is precisely what LPT does given that it schedules no more than two jobs per machine. 2

Ex.2.3 The lower bound (2.4) from section 2.3 still applies: Opt m p j /m. j=1 We say that a set of jobs j 1,..., j k forms a chain if j 1 j 2..., j k. Then, another lower bound on the optimal value is the maximum sum of processing times in any chain. Let Q be this maximum: Opt Q. Consider a schedule produced by the list scheduling algorithm and let C max be its length. Assume that at moment t 1 < C max, not all m machines are processing jobs, that means, some machines are idle at time t 1. Then any job that is available at time t 1 is being processed at that moment. Assume that also at t 2 with t 1 < t 2 < C max, not all machines are busy. Consider an arbitrary job j 2 that is processed at time t 2. Then at time t 1, either job j 2 is processed or some other job j 1 is processed with j 1 j 2. Now let T be the total time that at least one (and at most m 1) machine is idle. Then, by the reasoning above, we can find a chain of total processing time at least T. Hence, Opt Q T. Let B be the total time that all machines are busy. Then B j p j/m Opt. C max = T + B 2Opt. Ex. 2.4 (Note that this exercise gives a 2-approximation for the problem on related machines which is a more general model than the identical machine model for which we already know that list scheduling gives a 2-approximation.) (a) This can be done by binary search. Let P = j p j. The exercise does not mention that all processing times and speeds are integer but lets assume that this is the case. How many different values C max can we have? The length of the schedule on a machine i is K/s i for some K {0, 1,..., P }. That means, there are at most P +1 different values for the length on machine i. Apply binary search as in Section 3.2. To make it easier we may first guess the machine that determines the optimum makespan (that means, we do the binary search for all i = 1,..., m.) If we assume that machine i determines the optimal makespan then Opt must be a multiple of 1/s i. Maintain a lower bound L and an upper bound U such that L Opt and such that we have a schedule of length at most ρu. Start with L = 1/s i and U = P/s i. Now take T = (L + U)/2 and round it down to the nearest multiple of 1/s i. Apply the ρ-relaxed decision procedure. If it produces a schedule then set U T, otherwise let L = T + 1/s i. This continues until L = U. The number of steps for each i is O(log P ) which is polynomial in the input size. 3

(b) If all jobs are scheduled by this procedure then the length of the schedule is no more than 2D since no job starts after time D and the algorithm will only place a job j on machine i if p j /s i D. (Note that if a job has label i than it may be processed by a machine i < i but not by a machine i > i.) Assume now that not all jobs are scheduled by this algorithm. We prove that Opt > D in that case. Assume that job j is not scheduled by the algorithm and let it be labeled i. Then, any machine i i must be fully loaded, that means it has no idle time between time 0 and D. Moreover, any job scheduled on these machines must have a label i i (since the algorithm gives preference to job j above some job of label i > i). Let S be the set of jobs of label at most i. In any schedule with makespan D all these jobs are scheduled on the first i machines. But this is impossible since, as argued above, the total processing time of all jobs in S is at least id + p j > id. Ex. 2.5 (a) Let T be the tree found by the algorithm and let T be the optimal Steiner tree. We need to show that Cost(T ) 2Cost(T ). Consider the optimal tree T. Double its edges. We obtain a TSP-tour on R by making an Euler tour in this double tree and then shortcut the edges. (Just like we did in the double tree algorithm for TSP). The length of the resulting tour is most 2Cost(T ). By removing one edge from the TSP-tour we get a tree (actually even a TSP-path) on R. The cost of this tree is at least the cost of the computed optimal tree T since T is a minimal tree. We conclude that Cost(T ) 2Cost(T ). (b) Let ˆT be the optimal Steiner tree using the costs c ij. Then, from (a) we know that Cost(T ) 2Cost( ˆT ). We will next show that Cost(T ) Cost(T ) and Cost( ˆT ) Cost(T ). In the transformation from T to T, each time an edge (i, j) is replaced by a path from i to j whose total length is exactly the cost of edge (i, j). This results in a connected graph of the same cost. This graph contains a spanning tree T of cost at most Cost(T ). To see that Cost( ˆT ) Cost(T ) note that c ij c ij for any edge (i, j) E. Hence, Cost(T ) Cost(T ) 2Cost( ˆT ) 2Cost(T ). Ex.2.6 In Section 2.6 (Theorem 2.18) it was shown that the Minimum Degree Spanning Tree problem (MDST)is NP-complete. The proof was done by a 4

reduction from the Hamiltonian Path problem (HP). The HP problem is defined as follows: Given a graph G = (V, E), is there a path that goes through every vertex exactly once? It is easy to see that the question if a graph has a spanning tree with maximum degree at most two is the same as the Hamiltonian path problem. Assume that we have an α-approximation algorithm with α < 3/2. Let graph G be an instance of the HP problem. We apply the algorithm to G. If G has a Hamiltonian path then the algorithm will output a value at most α 2 < 3. If there is no Hamiltonian path then the algorithm will output a value at least 3. Therefore, such an algorithm can be used to solve the HP problem in polynomial time, which is impossible assuming that P N P. 5