Advanced Algorithms COMS31900 Approximation algorithms part two - - PowerPoint PPT Presentation

advanced algorithms coms31900 approximation algorithms
SMART_READER_LITE
LIVE PREVIEW

Advanced Algorithms COMS31900 Approximation algorithms part two - - PowerPoint PPT Presentation

Advanced Algorithms COMS31900 Approximation algorithms part two more constant factor approximations Rapha el Clifford Slides by Benjamin Sach Approximation Algorithms Recap An algorithm A is an -approximation algorithm for problem P


slide-1
SLIDE 1

Advanced Algorithms – COMS31900 Approximation algorithms part two more constant factor approximations

Rapha¨ el Clifford Slides by Benjamin Sach

slide-2
SLIDE 2

Approximation Algorithms Recap

An algorithm A is an α-approximation algorithm for problem P if,

  • A runs in polynomial time
  • A always outputs a solution with value s

Here P is an optimisation problem with optimal solution of value Opt

  • If P is a maximisation problem, Opt

α

s Opt

within an α factor of Opt

  • If P is a minimisation problem, Opt s α · Opt

We have seen a 3/2-approximation algorithm for Bin Packing (and a faster 2-approximation)

slide-3
SLIDE 3

Scheduling Jobs on Parallel Machines

1 2 3 4 5

m identical

machines

n jobs

time taken Goal: minimise the (wall-clock) time taken to process all jobs

slide-4
SLIDE 4

Scheduling Jobs on Parallel Machines

1 2 3 4 5

m identical

machines

n jobs

time taken Goal: minimise the (wall-clock) time taken to process all jobs (it’s NP-hard)

slide-5
SLIDE 5

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

slide-6
SLIDE 6

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • Job j takes tj time units
slide-7
SLIDE 7

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • We say that j ∈ J(i) iff job j is assigned to machine i
  • Job j takes tj time units
slide-8
SLIDE 8

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • We say that j ∈ J(i) iff job j is assigned to machine i
  • The load of machine i is Li =

j∈J(i) tj

  • Job j takes tj time units
slide-9
SLIDE 9

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • We say that j ∈ J(i) iff job j is assigned to machine i
  • The load of machine i is Li =

j∈J(i) tj

  • Job j takes tj time units

L2 L3 L1

slide-10
SLIDE 10

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • We say that j ∈ J(i) iff job j is assigned to machine i
  • The load of machine i is Li =

j∈J(i) tj

  • Job j takes tj time units
  • So the wall-clock time is maxi Li (which we want to minimise)

L2 L3 L1

slide-11
SLIDE 11

Scheduling Jobs on Parallel Machines

1 2 3 4 5 Goal: minimise the (wall-clock) time taken to process all jobs

wall-clock time (also called makespan)

  • We say that j ∈ J(i) iff job j is assigned to machine i
  • The load of machine i is Li =

j∈J(i) tj

  • Job j takes tj time units
  • So the wall-clock time is maxi Li (which we want to minimise)

L2 L3 L1 L1

slide-12
SLIDE 12

Scheduling Jobs on Parallel Machines

1 2 3 4 5

slide-13
SLIDE 13

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-14
SLIDE 14

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-15
SLIDE 15

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-16
SLIDE 16

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-17
SLIDE 17

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-18
SLIDE 18

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-19
SLIDE 19

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-20
SLIDE 20

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-21
SLIDE 21

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-22
SLIDE 22

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-23
SLIDE 23

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-24
SLIDE 24

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-25
SLIDE 25

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-26
SLIDE 26

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-27
SLIDE 27

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-28
SLIDE 28

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load

slide-29
SLIDE 29

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load How long does it take to compute this schedule?

slide-30
SLIDE 30

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load How long does it take to compute this schedule?

m machines n jobs

slide-31
SLIDE 31

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load How long does it take to compute this schedule?

O(nm) time naively, O(n log m) time using a priority queue m machines n jobs

slide-32
SLIDE 32

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load How long does it take to compute this schedule?

O(nm) time naively, O(n log m) time using a priority queue

(it’s also an online solution)

m machines n jobs

slide-33
SLIDE 33

Scheduling Jobs on Parallel Machines

1 2 3 4 5

Algorithm: Put job j on the machine i with smallest (current) load How long does it take to compute this schedule?

O(nm) time naively, O(n log m) time using a priority queue

How good is it? (it’s also an online solution)

m machines n jobs

slide-34
SLIDE 34

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-35
SLIDE 35

The greedy approximation

  • Before we prove this, we prove two useful facts,

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-36
SLIDE 36

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-37
SLIDE 37

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj

  • Some machine must process the largest job

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-38
SLIDE 38

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj Fact Opt

  • j tj

m

  • Some machine must process the largest job

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-39
SLIDE 39

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj Fact Opt

  • j tj

m

  • Some machine must process the largest job
  • There is a total of

j tj time units of work to be done

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-40
SLIDE 40

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj Fact Opt

  • j tj

m

  • Some machine must process the largest job
  • There is a total of

j tj time units of work to be done

  • Some machine i must have load Li at least
  • j tj

m

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-41
SLIDE 41

The greedy approximation

  • Before we prove this, we prove two useful facts,

Fact Opt maxj tj Fact Opt

  • j tj

m

  • Some machine must process the largest job
  • There is a total of

j tj time units of work to be done

  • Some machine i must have load Li at least
  • j tj

m

(the m machines can’t all have below average load) Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule Job j takes tj time units

Li is the load of

machine i

m machines n jobs

slide-42
SLIDE 42

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

m machines n jobs

slide-43
SLIDE 43

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm Proof Consider the machine i with largest load Tg = Li Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

m machines n jobs

slide-44
SLIDE 44

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm Proof Consider the machine i with largest load Tg = Li Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

slide-45
SLIDE 45

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

slide-46
SLIDE 46

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-47
SLIDE 47

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-48
SLIDE 48

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

slide-49
SLIDE 49

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-50
SLIDE 50

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj
  • So. . .

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-51
SLIDE 51

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-52
SLIDE 52

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-53
SLIDE 53

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-54
SLIDE 54

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-55
SLIDE 55

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

Fact Opt

  • j tj

m

slide-56
SLIDE 56

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-57
SLIDE 57

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

also tj Opt (by the first fact) Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-58
SLIDE 58

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

also tj Opt (by the first fact) Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

Fact Opt maxj tj

slide-59
SLIDE 59

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

also tj Opt (by the first fact) Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-60
SLIDE 60

The greedy approximation

Theorem The greedy algorithm given is a 2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tg = Li

  • When job j was assigned, machine i had the smallest load, Li − tj

Li − tj Lk for all 1 k m,

  • So. . .
  • If we then sum over all k,

m(Li − tj)

m

  • k=1

Lk

so (Li − tj)

m

k=1 Lk

m

Opt (by the second fact)

also tj Opt (by the first fact) Therefore, Tg = Li = (Li − tj) + tj Opt + Opt = 2Opt Let Opt denote the time taken by the optimal scheduling of jobs Let Tg denote the time taken by the greedy schedule

Li is the load of

machine i Job j takes tj time units

1 2 3 4 5

Li = Tg

m machines n jobs

job j

slide-61
SLIDE 61

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest)

slide-62
SLIDE 62

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest)

slide-63
SLIDE 63

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-64
SLIDE 64

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-65
SLIDE 65

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-66
SLIDE 66

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-67
SLIDE 67

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-68
SLIDE 68

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-69
SLIDE 69

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-70
SLIDE 70

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-71
SLIDE 71

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-72
SLIDE 72

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-73
SLIDE 73

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-74
SLIDE 74

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-75
SLIDE 75

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-76
SLIDE 76

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-77
SLIDE 77

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-78
SLIDE 78

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

slide-79
SLIDE 79

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

greedy solution

slide-80
SLIDE 80

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

greedy solution

How long does it take to compute this schedule?

slide-81
SLIDE 81

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

greedy solution

How long does it take to compute this schedule?

O(n log n) time (to sort the jobs)

slide-82
SLIDE 82

Longest Processing Time (LPT)

1 2 3 4 5

Step 1: Sort the jobs into non-increasing order (job 1 is now largest) Step 2: Put job j on the machine i with smallest (current) load

greedy solution

How long does it take to compute this schedule?

O(n log n) time (to sort the jobs)

How good is it?

slide-83
SLIDE 83

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let Tl denote the time taken by the LPT schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-84
SLIDE 84

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma
  • Let Tl denote the time taken by the LPT schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-85
SLIDE 85

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal

  • Let Tl denote the time taken by the LPT schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-86
SLIDE 86

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal LPT gives each job its own machine so maxi Li maxj tj Opt

  • Let Tl denote the time taken by the LPT schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-87
SLIDE 87

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Let Tl denote the time taken by the LPT schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-88
SLIDE 88

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Let Tl denote the time taken by the LPT schedule

Proof

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-89
SLIDE 89

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Note that t1 t2 t3 . . . tm t(m+1)
  • Let Tl denote the time taken by the LPT schedule

Proof

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-90
SLIDE 90

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Note that t1 t2 t3 . . . tm t(m+1)
  • One of the m machines must be assigned
  • Let Tl denote the time taken by the LPT schedule

Proof (at least) two of these m + 1 jobs under any schedule

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-91
SLIDE 91

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Note that t1 t2 t3 . . . tm t(m+1)
  • One of the m machines must be assigned
  • Let Tl denote the time taken by the LPT schedule

Proof (at least) two of these m + 1 jobs under any schedule

  • So we have that any schedule takes at least 2t(m+1) time

Li is the load of

machine i

m machines n jobs

Job j takes tj time units If there are at most m jobs then

slide-92
SLIDE 92

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Before we prove this, we prove another useful fact and a Lemma

Fact If there are at most m jobs (n m) then LPT is optimal Lemma If n > m then Opt 2t(m+1) (after sorting) LPT gives each job its own machine so maxi Li maxj tj Opt

  • Note that t1 t2 t3 . . . tm t(m+1)
  • One of the m machines must be assigned
  • Let Tl denote the time taken by the LPT schedule

Proof (at least) two of these m + 1 jobs under any schedule

  • So we have that any schedule takes at least 2t(m+1) time

Li is the load of

machine i

m machines n jobs

in particular Opt 2t(m+1) Job j takes tj time units If there are at most m jobs then

slide-93
SLIDE 93

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-94
SLIDE 94

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm Proof Consider the machine i with largest load Tl = Li

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-95
SLIDE 95

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

slide-96
SLIDE 96

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-97
SLIDE 97

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-98
SLIDE 98

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-99
SLIDE 99

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-100
SLIDE 100

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5 because LPT is optimal in this case

slide-101
SLIDE 101

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-102
SLIDE 102

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-103
SLIDE 103

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

Fact Opt maxj tj

slide-104
SLIDE 104

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-105
SLIDE 105

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-106
SLIDE 106

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-107
SLIDE 107

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-108
SLIDE 108

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

it doesn’t assign a second job to any machine until

every machine has at least one job

slide-109
SLIDE 109

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-110
SLIDE 110

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

tj tm+1 Opt/2 (by the Lemma) Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-111
SLIDE 111

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

tj tm+1 Opt/2 (by the Lemma) Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

Lemma If n > m then Opt 2t(m+1) (after sorting)

slide-112
SLIDE 112

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

tj tm+1 Opt/2 (by the Lemma) Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-113
SLIDE 113

The LPT approximation

Theorem The LPT algorithm is a 3/2-approximation algorithm

  • Let j denote the last job machine i completes

Proof Consider the machine i with largest load Tl = Li

  • Using the same argument as before, we have that,

(Li − tj) Opt

Therefore, Tl = Li = (Li − tj) + tj Opt + Opt/2 = (3/2) · Opt

  • If n m then we are done so assume n > m
  • Further if (Li − tj) = 0 then Tl = Li = tj Opt

so assume that (Li − tj) > 0

  • Therefore machine i was assigned at least two jobs

By the algorithm description, we have that j m + 1

tj tm+1 Opt/2 (by the Lemma) Li is the load of

machine i

m machines n jobs

Job j takes tj time units

job j 1 2 3 4 5

slide-114
SLIDE 114

Scheduling conclusions

Theorem The LPT algorithm is a 3/2-approximation algorithm which runs in O(n log n) time Theorem The greedy algorithm is a 2-approximation algorithm which runs in O(n log m) time and it’s online In fact, LPT is a 4/3-approximation algorithm (using better analysis)

m machines n jobs

slide-115
SLIDE 115

k-centers

slide-116
SLIDE 116

k-centers

slide-117
SLIDE 117

k-centers

n points (sites) in 2D space

slide-118
SLIDE 118

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2
slide-119
SLIDE 119

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

(i.e. ‘normal’ euclidean distance)

slide-120
SLIDE 120

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Select k sites to be centers

(i.e. ‘normal’ euclidean distance)

slide-121
SLIDE 121

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Select k sites to be centers

(i.e. ‘normal’ euclidean distance)

slide-122
SLIDE 122

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Select k sites to be centers

slide-123
SLIDE 123

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

slide-124
SLIDE 124

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

slide-125
SLIDE 125

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

r r

slide-126
SLIDE 126

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

slide-127
SLIDE 127

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

slide-128
SLIDE 128

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center Select k sites to be centers

r

slide-129
SLIDE 129

k-centers

n points (sites) in 2D space

The distance between points si, sj is

  • (xi − xj)2 + (yi − yj)2

Goal Minimise the largest distance from any site to the closest center (in general it’s NP-hard) Select k sites to be centers

r

slide-130
SLIDE 130

A Greedy approximation

slide-131
SLIDE 131

Start by picking any point to be a center

A Greedy approximation

slide-132
SLIDE 132

Start by picking any point to be a center

A Greedy approximation

slide-133
SLIDE 133

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-134
SLIDE 134

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-135
SLIDE 135

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-136
SLIDE 136

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-137
SLIDE 137

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-138
SLIDE 138

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-139
SLIDE 139

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-140
SLIDE 140

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-141
SLIDE 141

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-142
SLIDE 142

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-143
SLIDE 143

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-144
SLIDE 144

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-145
SLIDE 145

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-146
SLIDE 146

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation

slide-147
SLIDE 147

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center

A Greedy approximation r

slide-148
SLIDE 148

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center This takes O(nk) time

A Greedy approximation

slide-149
SLIDE 149

Start by picking any point to be a center Repeatedly pick the site which is furthest from any existing center This takes O(nk) time

A Greedy approximation

but is it any good?

slide-150
SLIDE 150

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal)

slide-151
SLIDE 151

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt

slide-152
SLIDE 152

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

slide-153
SLIDE 153

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

slide-154
SLIDE 154

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

slide-155
SLIDE 155

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

purposes only Disclaimer: for illustrative

slide-156
SLIDE 156

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

purposes only Disclaimer: for illustrative

Greedy centers

slide-157
SLIDE 157

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

purposes only Disclaimer: for illustrative

Greedy centers

slide-158
SLIDE 158

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

purposes only Disclaimer: for illustrative

Greedy centers Distance at most 2Opt

slide-159
SLIDE 159

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 1: No si, si′ ∈ Cg are closest to the same sj ∈ COpt Optimal centers

Opt

Sites

purposes only Disclaimer: for illustrative

Greedy centers Distance at most 2Opt so rg 2Opt

slide-160
SLIDE 160

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt

slide-161
SLIDE 161

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt

si si′

slide-162
SLIDE 162

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′

slide-163
SLIDE 163

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

slide-164
SLIDE 164

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

the furthest from any existing Greedy center

slide-165
SLIDE 165

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

the furthest from any existing Greedy center However, si is at most 2Opt away from si′

slide-166
SLIDE 166

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

the furthest from any existing Greedy center However, si is at most 2Opt away from si′

slide-167
SLIDE 167

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

the furthest from any existing Greedy center However, si is at most 2Opt away from si′ So even before adding si as a center, all sites were 2Opt away from a Greedy center

slide-168
SLIDE 168

The Greedy approximation

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm Let Cg (resp. COpt) denote the set of centers selected by Greedy (resp. Optimal) Proof Let rg (resp. Opt) denote largest site-center distance using Greedy (resp. Optimal) Case 2: Some si, si′ ∈ Cg are closest to the same sj ∈ COpt Assume wlog. that Greedy made si a center after si′

si si′ si was added as a center because it was

the furthest from any existing Greedy center However, si is at most 2Opt away from si′ So even before adding si as a center, all sites were 2Opt away from a Greedy center Therefore, rg 2Opt

slide-169
SLIDE 169

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

slide-170
SLIDE 170

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,
slide-171
SLIDE 171

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,

d(si, sj) = L1 or L∞ for example

slide-172
SLIDE 172

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,

d(si, sj) = L1 or L∞ for example d(x, y) = d(y, x), d(x, y) 0

  • Distance function d is a metric iff

(d(x, y) = 0 iff x = y) and d(x, z) d(x, y) + d(y, z)

slide-173
SLIDE 173

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,

d(si, sj) = L1 or L∞ for example

  • For a general (metric) d, the problem is not α-approximable with α < 2

d(x, y) = d(y, x), d(x, y) 0

  • Distance function d is a metric iff

(d(x, y) = 0 iff x = y) and d(x, z) d(x, y) + d(y, z)

slide-174
SLIDE 174

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,

d(si, sj) = L1 or L∞ for example

  • For a general (metric) d, the problem is not α-approximable with α < 2

d(x, y) = d(y, x), d(x, y) 0

  • For d = L2 , the problem is not α-approximable with α <

√ 3 ≈ 1.73

  • Distance function d is a metric iff

(d(x, y) = 0 iff x = y) and d(x, z) d(x, y) + d(y, z)

slide-175
SLIDE 175

k-center Conclusions

Theorem The Greedy algorithm for k-center is a 2-approximation algorithm which runs in O(nk) time

  • The approximation works for any (metric) distance function,

d(si, sj) = L1 or L∞ for example

  • For a general (metric) d, the problem is not α-approximable with α < 2

d(x, y) = d(y, x), d(x, y) 0

  • For d = L2 , the problem is not α-approximable with α <

√ 3 ≈ 1.73

  • For d = L1 or d = L∞ , the problem is not α-approximable with α < 2
  • Distance function d is a metric iff

(d(x, y) = 0 iff x = y) and d(x, z) d(x, y) + d(y, z)