Greedy and Local Search Advanced Algorithms Nanjing University, - - PowerPoint PPT Presentation

β–Ά
greedy and local search
SMART_READER_LITE
LIVE PREVIEW

Greedy and Local Search Advanced Algorithms Nanjing University, - - PowerPoint PPT Presentation

Approximation Algorithms Greedy and Local Search Advanced Algorithms Nanjing University, Fall 2018 Set Cover Instance: Given a collection of subsets 1 , 2 , , , find the smallest [] such that


slide-1
SLIDE 1

Approximation Algorithms

Greedy and Local Search

Advanced Algorithms Nanjing University, Fall 2018

slide-2
SLIDE 2

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

slide-3
SLIDE 3

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

slide-4
SLIDE 4

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

slide-5
SLIDE 5

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

  • This problem is NP-hard!
  • Decision version is one of Karp’s

21 NP-complete problems.

slide-6
SLIDE 6

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

  • This problem is NP-hard!
  • Decision version is one of Karp’s

21 NP-complete problems.

  • Can we find good enough

solutions efficiently?

slide-7
SLIDE 7

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. 𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

slide-8
SLIDE 8

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. 𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

OPT(𝐽): value of minimum set cover of instance 𝐽 SOL(𝐽): value of set cover returned by GreedyCover on instance 𝐽

slide-9
SLIDE 9

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. 𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

OPT(𝐽): value of minimum set cover of instance 𝐽 SOL(𝐽): value of set cover returned by GreedyCover on instance 𝐽

GreedyCover has approximation ratio 𝛽 if βˆ€ instance 𝐽, SOL(𝐽) OPT(𝐽) ≀ 𝛽

slide-10
SLIDE 10

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. 𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

OPT(𝐽): value of minimum set cover of instance 𝐽 SOL(𝐽): value of set cover returned by GreedyCover on instance 𝐽

GreedyCover has approximation ratio 𝛽 if βˆ€ instance 𝐽, SOL(𝐽) OPT(𝐽) ≀ 𝛽

For minimization problems, we want Ξ€ SOL(𝐽) OPT 𝐽 ≀ 𝛽 where 𝛽 β‰₯ 1 For maximization problems, we want Ξ€ SOL(𝐽) OPT 𝐽 β‰₯ 𝛽 where 𝛽 ≀ 1

slide-11
SLIDE 11

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. Set π‘žπ‘ π‘—π‘‘π‘“ 𝑓 =

1 |π‘‡π‘—βˆ©π‘‰| for all 𝑓 ∈ 𝑇𝑗 ∩ 𝑉.

𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

  • Initially, there must exist some subset that covers its elements with price at most

Ξ€ OPT(𝐽) π‘œ.

  • Therefore, price of elements in the first subset covered by GreedyCover is at most

Ξ€ OPT(𝐽) π‘œ.

  • After 𝑙 elements in 𝑒 subsets are covered by GreedyCover, there must exist some subset such

that the price of its uncovered elements is at most Ξ€ OPT(𝐽𝑒) (π‘œ βˆ’ 𝑙) ≀ Ξ€ OPT(𝐽) (π‘œ βˆ’ 𝑙).

  • In general, GreedyCover pays at most

Ξ€ OPT(𝐽) (π‘œ βˆ’ 𝑙 + 1) to cover the 𝑙th chosen element.

𝐷 = ෍

π‘“βˆˆπ‘‰

π‘žπ‘ π‘—π‘‘π‘“(𝑓)

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

π‘žπ‘ π‘—π‘‘π‘“ = 1 π‘žπ‘ π‘—π‘‘π‘“ = 1

slide-12
SLIDE 12

π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

π‘žπ‘ π‘—π‘‘π‘“ = 1 π‘žπ‘ π‘—π‘‘π‘“ = 1

Enumerate 𝑓𝑙 in the order in which they are covered by GreedyCover: π‘žπ‘ π‘—π‘‘π‘“ 𝑓𝑙 ≀ OPT 𝐽 π‘œ βˆ’ 𝑙 + 1

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. Set π‘žπ‘ π‘—π‘‘π‘“ 𝑓 =

1 |π‘‡π‘—βˆ©π‘‰| for all 𝑓 ∈ 𝑇𝑗 ∩ 𝑉.

𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

slide-13
SLIDE 13

π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

π‘žπ‘ π‘—π‘‘π‘“ = 1 π‘žπ‘ π‘—π‘‘π‘“ = 1

Enumerate 𝑓𝑙 in the order in which they are covered by GreedyCover: π‘žπ‘ π‘—π‘‘π‘“ 𝑓𝑙 ≀ OPT 𝐽 π‘œ βˆ’ 𝑙 + 1

𝐷 = ෍

π‘“βˆˆπ‘‰

π‘žπ‘ π‘—π‘‘π‘“(𝑓) ≀ ෍

𝑙=1 π‘œ

OPT 𝐽 π‘œ βˆ’ 𝑙 + 1 = πΌπ‘œ β‹… OPT(𝐽)

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. Set π‘žπ‘ π‘—π‘‘π‘“ 𝑓 =

1 |π‘‡π‘—βˆ©π‘‰| for all 𝑓 ∈ 𝑇𝑗 ∩ 𝑉.

𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

slide-14
SLIDE 14

π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

π‘žπ‘ π‘—π‘‘π‘“ = 1 π‘žπ‘ π‘—π‘‘π‘“ = 1

  • GreedyCover has approximation ratio πΌπ‘œ β‰ˆ ln π‘œ + 𝑃(1).

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. Set π‘žπ‘ π‘—π‘‘π‘“ 𝑓 =

1 |π‘‡π‘—βˆ©π‘‰| for all 𝑓 ∈ 𝑇𝑗 ∩ 𝑉.

𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

slide-15
SLIDE 15

π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3 π‘žπ‘ π‘—π‘‘π‘“ = Ξ€ 1 3

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

π‘žπ‘ π‘—π‘‘π‘“ = 1 π‘žπ‘ π‘—π‘‘π‘“ = 1

  • GreedyCover has approximation ratio πΌπ‘œ β‰ˆ ln π‘œ + 𝑃(1).
  • [Lund, Yannakakis 1994; Feige 1998] There is no poly-time 1 βˆ’ 𝑝 1

ln(π‘œ)

  • approx. algorithm unless NP = quasi-poly-time.
  • [Ras, Safra 1997] For some constant 𝑑, there is no poly-time 𝑑 ln(π‘œ) approx.

algorithm unless NP = P.

  • [Dinur, Steuer 2014] There is no poly-time 1 βˆ’ 𝑝 1

ln(π‘œ) approx. algorithm unless NP = P.

Set Cover Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

GreedyCover: Set 𝐷 = βˆ…. While 𝑉 β‰  βˆ… do: Add 𝑗 with largest |𝑇𝑗 ∩ 𝑉| to 𝐷. Set π‘žπ‘ π‘—π‘‘π‘“ 𝑓 =

1 |π‘‡π‘—βˆ©π‘‰| for all 𝑓 ∈ 𝑇𝑗 ∩ 𝑉.

𝑉 = 𝑉 βˆ’ 𝑇𝑗. Return 𝐷.

slide-16
SLIDE 16

Set Cover

Instance: Given a collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉, find the smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4 𝑉

  • This problem is NP-hard.
  • We have 𝑃(ln π‘œ) approx. alg.
  • Frequency of an element:

# of subsets the element is in.

  • Use 𝑔

𝐽 to denote the frequency

  • f the most frequent element in

instance 𝐽.

slide-17
SLIDE 17

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-18
SLIDE 18

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷|

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-19
SLIDE 19

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷| As a result, βˆ€π‘: 𝑁 ≀ OPTprimal = min |𝐷|

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-20
SLIDE 20

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷| As a result, βˆ€π‘: 𝑁 ≀ OPTprimal = min |𝐷| GreedyMatchingCover: Find arbitrary maximal 𝑁 for the dual problem. Return 𝐷 = {𝑗: 𝑇𝑗 ∩ 𝑁 β‰  βˆ…}.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-21
SLIDE 21

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷| As a result, βˆ€π‘: 𝑁 ≀ OPTprimal = min |𝐷| GreedyMatchingCover: Find arbitrary maximal 𝑁 for the dual problem. Return 𝐷 = {𝑗: 𝑇𝑗 ∩ 𝑁 β‰  βˆ…}. Since 𝑁 is maximal, returned 𝐷 must be a cover.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-22
SLIDE 22

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷| As a result, βˆ€π‘: 𝑁 ≀ OPTprimal = min |𝐷| GreedyMatchingCover: Find arbitrary maximal 𝑁 for the dual problem. Return 𝐷 = {𝑗: 𝑇𝑗 ∩ 𝑁 β‰  βˆ…}. Since 𝑁 is maximal, returned 𝐷 must be a cover. 𝐷 ≀ 𝑔

𝐽 β‹… 𝑁 ≀ 𝑔 𝐽 β‹… OPTprimal

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-23
SLIDE 23

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛].

Since every 𝑓 ∈ 𝑁 must consume a subset to cover βˆ€π·, βˆ€π‘: 𝑁 ≀ |𝐷| As a result, βˆ€π‘: 𝑁 ≀ OPTprimal = min |𝐷| GreedyMatchingCover: Find arbitrary maximal 𝑁 for the dual problem. Return 𝐷 = {𝑗: 𝑇𝑗 ∩ 𝑁 β‰  βˆ…}. Since 𝑁 is maximal, returned 𝐷 must be a cover. 𝐷 ≀ 𝑔

𝐽 β‹… 𝑁 ≀ 𝑔 𝐽 β‹… OPTprimal

GreedyMatchingCover has approximation ratio 𝑔

𝐽.

𝑇2 𝑇3 𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑇1 𝑇4

slide-24
SLIDE 24

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Set Cover: Find smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

What if the frequency of each element is exactly 2?

slide-25
SLIDE 25

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Set Cover: Find smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

What if the frequency of each element is exactly 2?

𝑀1 𝑀2 𝑀3 𝑀4 𝑓1 𝑓2 𝑓3 𝑓4 𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4 incidence graph

slide-26
SLIDE 26

Vertex Cover

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Set Cover: Find smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

What if the frequency of each element is exactly 2?

𝑀1 𝑀2 𝑀3 𝑀4 𝑓1 𝑓2 𝑓3 𝑓4 𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4 incidence graph

Instance: An undirected simple graph 𝐻 = (π‘Š, 𝐹). Vertex Cover: Find smallest 𝐷 βŠ† π‘Š s.t. βˆ€π‘“ ∈ 𝐹: 𝑓 ∩ 𝐷 β‰  βˆ….

slide-27
SLIDE 27

Vertex Cover

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Set Cover: Find smallest 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉.

What if the frequency of each element is exactly 2?

𝑀1 𝑀2 𝑀3 𝑀4 𝑓1 𝑓2 𝑓3 𝑓4 𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4 incidence graph

Instance: An undirected simple graph 𝐻 = (π‘Š, 𝐹). Vertex Cover: Find smallest 𝐷 βŠ† π‘Š s.t. βˆ€π‘“ ∈ 𝐹: 𝑓 ∩ 𝐷 β‰  βˆ….

  • Vertex cover is also NP-hard.
  • Decision version is one of Karp’s 21 NP-complete problems.
slide-28
SLIDE 28

𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛]. Instance: An undirected simple graph 𝐻 = (π‘Š, 𝐹). Primal: Find 𝐷 βŠ† π‘Š s.t. βˆ€π‘“ ∈ 𝐹: 𝑓 ∩ 𝐷 β‰  βˆ…. (Vertex Cover) Dual: Find 𝑁 βŠ† 𝐹 s.t. βˆ€π‘€ ∈ π‘Š: 𝑀 ∩ 𝑁 ≀ 1. (Matching)

The frequency of each element is exactly 2

slide-29
SLIDE 29

𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛]. Instance: An undirected simple graph 𝐻 = (π‘Š, 𝐹). Primal: Find 𝐷 βŠ† π‘Š s.t. βˆ€π‘“ ∈ 𝐹: 𝑓 ∩ 𝐷 β‰  βˆ…. (Vertex Cover) Dual: Find 𝑁 βŠ† 𝐹 s.t. βˆ€π‘€ ∈ π‘Š: 𝑀 ∩ 𝑁 ≀ 1. (Matching)

The frequency of each element is exactly 2

GreedyMatchingCover: Find arbitrary maximal matching 𝑁 of the input graph. Return 𝐷 = {𝑀: 𝑀 ∈ π‘Š and 𝑀 ∩ 𝑁 β‰  βˆ…}.

A 2-approximation algorithm for the vertex cover problem

slide-30
SLIDE 30

𝑀2 𝑀3 𝑓1 𝑓2 𝑓3 𝑓4 𝑀1 𝑀4

Instance: A collection of subsets 𝑇1, 𝑇2, β‹― , 𝑇𝑛 βŠ† 𝑉. Primal: Find 𝐷 βŠ† [𝑛] such that Ϊ‚π‘—βˆˆπ· 𝑇𝑗 = 𝑉. Dual: Find 𝑁 βŠ† 𝑉 such that 𝑇𝑗 ∩ 𝑁 ≀ 1 for all 𝑗 ∈ [𝑛]. Instance: An undirected simple graph 𝐻 = (π‘Š, 𝐹). Primal: Find 𝐷 βŠ† π‘Š s.t. βˆ€π‘“ ∈ 𝐹: 𝑓 ∩ 𝐷 β‰  βˆ…. (Vertex Cover) Dual: Find 𝑁 βŠ† 𝐹 s.t. βˆ€π‘€ ∈ π‘Š: 𝑀 ∩ 𝑁 ≀ 1. (Matching)

The frequency of each element is exactly 2

GreedyMatchingCover: Find arbitrary maximal matching 𝑁 of the input graph. Return 𝐷 = {𝑀: 𝑀 ∈ π‘Š and 𝑀 ∩ 𝑁 β‰  βˆ…}.

A 2-approximation algorithm for the vertex cover problem

  • There is no poly-time <1.36-approx. alg. unless P = NP.
  • Assuming the unique game conjecture, there is no poly-time (2-Ξ΅)-approx. alg.
slide-31
SLIDE 31

Scheduling

𝑛 identical machines

slide-32
SLIDE 32

Scheduling

𝑛 identical machines π‘œ jobs processing time π‘žπ‘˜ 6 1 4 2 3 3 5 2 4 3

slide-33
SLIDE 33

Scheduling

𝑛 machines π‘œ jobs each with processing time π‘žπ‘˜

slide-34
SLIDE 34

Scheduling

Completion time:

(of machine 𝑗)

𝐷𝑗 = ෍

π‘˜: jobs assigned to machine 𝑗

π‘žπ‘˜

𝑛 machines π‘œ jobs each with processing time π‘žπ‘˜

slide-35
SLIDE 35

Scheduling

Completion time:

(of machine 𝑗)

Makespan: 𝐷𝑗 = ෍

π‘˜: jobs assigned to machine 𝑗

π‘žπ‘˜

𝐷max = max

𝑗

𝐷𝑗

𝑛 machines π‘œ jobs each with processing time π‘žπ‘˜ makespan

slide-36
SLIDE 36

Instance: π‘œ jobs π‘˜ = 1,2, β‹― , π‘œ each with processing time π‘žπ‘˜ ∈ β„€+. Problem: Find a schedule assigning π‘œ jobs to 𝑛 identical machines so as the minimize the makespan.

slide-37
SLIDE 37

Instance: π‘œ jobs π‘˜ = 1,2, β‹― , π‘œ each with processing time π‘žπ‘˜ ∈ β„€+. Problem: Find a schedule assigning π‘œ jobs to 𝑛 identical machines so as the minimize the makespan.

  • β€œminimum makespan on identical machines”
  • Scheduling problem has many variations:

machines could be different, jobs could have release-dates/deadlines, etc…

slide-38
SLIDE 38

Instance: π‘œ jobs π‘˜ = 1,2, β‹― , π‘œ each with processing time π‘žπ‘˜ ∈ β„€+. Problem: Find a schedule assigning π‘œ jobs to 𝑛 identical machines so as the minimize the makespan.

  • β€œminimum makespan on identical machines”
  • Scheduling problem has many variations:

machines could be different, jobs could have release-dates/deadlines, etc… If 𝑛 = 2, the scheduling problem can be used to solve the partition problem!

Instance: π‘œ positive integers 𝑦1, 𝑦2, β‹― , π‘¦π‘œ ∈ β„€+. Problem: Determine whether there exists a partition of {1,2, β‹― , π‘œ} into two sets 𝐡 and 𝐢 such that Οƒπ‘—βˆˆπ΅ 𝑦𝑗 = Οƒπ‘—βˆˆπΆ 𝑦𝑗.

slide-39
SLIDE 39

Instance: π‘œ jobs π‘˜ = 1,2, β‹― , π‘œ each with processing time π‘žπ‘˜ ∈ β„€+. Problem: Find a schedule assigning π‘œ jobs to 𝑛 identical machines so as the minimize the makespan.

  • β€œminimum makespan on identical machines”
  • Scheduling problem has many variations:

machines could be different, jobs could have release-dates/deadlines, etc… If 𝑛 = 2, the scheduling problem can be used to solve the partition problem!

Instance: π‘œ positive integers 𝑦1, 𝑦2, β‹― , π‘¦π‘œ ∈ β„€+. Problem: Determine whether there exists a partition of {1,2, β‹― , π‘œ} into two sets 𝐡 and 𝐢 such that Οƒπ‘—βˆˆπ΅ 𝑦𝑗 = Οƒπ‘—βˆˆπΆ 𝑦𝑗.

  • The partition problem is one of Karp’s 21 NP-complete problems.
  • Thus the considered scheduling problem is NP-hard.
slide-40
SLIDE 40

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-41
SLIDE 41

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-42
SLIDE 42

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-43
SLIDE 43

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-44
SLIDE 44

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-45
SLIDE 45

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-46
SLIDE 46

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-47
SLIDE 47

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-48
SLIDE 48

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-49
SLIDE 49

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-50
SLIDE 50

Graham’s Li List Algorithm for Scheduling

𝑛 identical machines π‘œ jobs each with processing time π‘žπ‘˜

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-51
SLIDE 51

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-52
SLIDE 52

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time.

slide-53
SLIDE 53

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio?

slide-54
SLIDE 54

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜

slide-55
SLIDE 55

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜

slide-56
SLIDE 56

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Assume machine 𝑙 finishes last in the schedule, and last job on it is π‘š.

slide-57
SLIDE 57

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Assume machine 𝑙 finishes last in the schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

slide-58
SLIDE 58

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Assume machine 𝑙 finishes last in the schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT

slide-59
SLIDE 59

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Assume machine 𝑙 finishes last in the schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT

𝐷𝑙 βˆ’ π‘žπ‘š ≀

1 𝑛 Οƒπ‘˜β‰ π‘š π‘žπ‘˜ ≀ 1 𝑛 Οƒπ‘˜ π‘žπ‘˜ ≀ OPT

since machine 𝑙 is least loaded when scheduling job π‘š

slide-60
SLIDE 60

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. What about the approximation ratio? OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Assume machine 𝑙 finishes last in the schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT

𝐷𝑙 βˆ’ π‘žπ‘š ≀

1 𝑛 Οƒπ‘˜β‰ π‘š π‘žπ‘˜ ≀ 1 𝑛 Οƒπ‘˜ π‘žπ‘˜ ≀ OPT

since machine 𝑙 is least loaded when scheduling job π‘š

≀ 2 β‹… OPT

slide-61
SLIDE 61

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

Algorithm List finishes within poly-time. Algorithm List has approximation ratio 2. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT ≀ 2 β‹… OPT

slide-62
SLIDE 62

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

Algorithm List finishes within poly-time. Algorithm List has approximation ratio 2. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT ≀ 2 β‹… OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛

slide-63
SLIDE 63

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

Algorithm List finishes within poly-time. Algorithm List has approximation ratio 2. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT ≀ 2 β‹… OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛 ≀ 2 βˆ’ 1 𝑛 β‹… OPT

slide-64
SLIDE 64

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

Algorithm List finishes within poly-time. Algorithm List has approximation ratio 2. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT ≀ 2 β‹… OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛 ≀ 2 βˆ’ 1 𝑛 β‹… OPT Algorithm List has approximation ratio 2 βˆ’ Ξ€ 1 𝑛.

slide-65
SLIDE 65

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

Algorithm List finishes within poly-time. Algorithm List has approximation ratio 2. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT ≀ 2 β‹… OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛 ≀ 2 βˆ’ 1 𝑛 β‹… OPT Algorithm List has approximation ratio 2 βˆ’ Ξ€ 1 𝑛.

This bound is tight in the worst case. [Almost tight example: 𝑛2 unit jobs followed by a length 𝑛 job. List generates makespan of 2𝑛 while OPT = 𝑛 + 1.]

slide-66
SLIDE 66

Local Search for Scheduling

Start with an arbitrary solution: Keep making improvements by locally adjusting the solution, until no further improvement can be made (local optimum)

slide-67
SLIDE 67

Local Search for Scheduling

Start with an arbitrary solution: Keep making improvements by locally adjusting the solution, until no further improvement can be made (local optimum)

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

slide-68
SLIDE 68

Local Search for Scheduling

Start with an arbitrary solution: Keep making improvements by locally adjusting the solution, until no further improvement can be made (local optimum)

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

slide-69
SLIDE 69

Local Search for Scheduling

Start with an arbitrary solution: Keep making improvements by locally adjusting the solution, until no further improvement can be made (local optimum)

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

slide-70
SLIDE 70

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

slide-71
SLIDE 71

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!)

slide-72
SLIDE 72

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

slide-73
SLIDE 73

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜

slide-74
SLIDE 74

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜

slide-75
SLIDE 75

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

slide-76
SLIDE 76

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT

slide-77
SLIDE 77

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛

slide-78
SLIDE 78

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗.

This algorithm finishes within poly-time. (No job is transferred twice!) The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. OPT β‰₯ max

π‘˜

π‘žπ‘˜ 𝑛 β‹… OPT β‰₯ ෍

π‘˜

π‘žπ‘˜ Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š π‘žπ‘š ≀ max

π‘˜

π‘žπ‘˜ ≀ OPT 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜β‰ π‘š

π‘žπ‘˜ = 1 𝑛 ෍

π‘˜

π‘žπ‘˜ βˆ’ π‘žπ‘š 𝑛 ≀ 2 βˆ’ 1 𝑛 β‹… OPT

(2 βˆ’ Ξ€ 1 𝑛)

slide-79
SLIDE 79

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗. List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-80
SLIDE 80

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗. List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine. LocalSearch finds a schedule with makespan 𝐷max ≀ 2 βˆ’ 1

𝑛 β‹… OPT

slide-81
SLIDE 81

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗. List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine. LocalSearch finds a schedule with makespan 𝐷max ≀ 2 βˆ’ 1

𝑛 β‹… OPT

The schedule returned by List must be a local optimum!

slide-82
SLIDE 82

LocalSearch: Start with an arbitrary schedule. Repeat until no job can be reassigned (i.e., local optimum reached): Let π‘š be a job that finished last. If exists machine 𝑗 s.t. assigning job π‘š to 𝑗 allows π‘š finish earlier: Transfer job π‘š to earliest such 𝑗. List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine. LocalSearch finds a schedule with makespan 𝐷max ≀ 2 βˆ’ 1

𝑛 β‹… OPT

The schedule returned by List must be a local optimum! List will find a schedule with makespan 𝐷max ≀ 2 βˆ’ 1 𝑛 β‹… OPT

slide-83
SLIDE 83

𝑛 identical machines π‘œ jobs

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-84
SLIDE 84

𝑛 identical machines π‘œ jobs

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-85
SLIDE 85

Longest Processing Time (L (LPT)

𝑛 identical machines π‘œ jobs

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-86
SLIDE 86

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-87
SLIDE 87

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

slide-88
SLIDE 88

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š

slide-89
SLIDE 89

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT

slide-90
SLIDE 90

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT

slide-91
SLIDE 91

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT W.l.o.g.: β€’ # of jobs > # of machines (i.e., π‘œ > 𝑛)

  • makespan is achieved by some job bigger than 𝑛 (i.e., π‘š > 𝑛)

Otherwise, LPT returns an optimal solution already!

slide-92
SLIDE 92

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT W.l.o.g.: β€’ # of jobs > # of machines (i.e., π‘œ > 𝑛)

  • makespan is achieved by some job bigger than 𝑛 (i.e., π‘š > 𝑛)

Otherwise, LPT returns an optimal solution already! π‘žπ‘› + π‘žπ‘›+1 ≀ OPT

slide-93
SLIDE 93

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT W.l.o.g.: β€’ # of jobs > # of machines (i.e., π‘œ > 𝑛)

  • makespan is achieved by some job bigger than 𝑛 (i.e., π‘š > 𝑛)

Otherwise, LPT returns an optimal solution already! π‘žπ‘› + π‘žπ‘›+1 ≀ OPT π‘žπ‘š ≀ π‘žπ‘›+1

slide-94
SLIDE 94

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT W.l.o.g.: β€’ # of jobs > # of machines (i.e., π‘œ > 𝑛)

  • makespan is achieved by some job bigger than 𝑛 (i.e., π‘š > 𝑛)

Otherwise, LPT returns an optimal solution already! π‘žπ‘› + π‘žπ‘›+1 ≀ OPT π‘žπ‘š ≀ π‘žπ‘›+1 π‘žπ‘š ≀ π‘žπ‘›+1 ≀ 1 2 π‘žπ‘› + π‘žπ‘›+1 ≀ OPT 2

slide-95
SLIDE 95

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

This algorithm finishes within poly-time. The approximation ratio of this algorithm?

Assume machine 𝑙 finishes last in final schedule, and last job on it is π‘š. Makespan 𝐷max = 𝐷𝑙 = 𝐷𝑙 βˆ’ π‘žπ‘š + π‘žπ‘š 𝐷𝑙 βˆ’ π‘žπ‘š ≀ 1 𝑛 ෍

π‘˜

π‘žπ‘˜ ≀ OPT W.l.o.g.: β€’ # of jobs > # of machines (i.e., π‘œ > 𝑛)

  • makespan is achieved by some job bigger than 𝑛 (i.e., π‘š > 𝑛)

Otherwise, LPT returns an optimal solution already! π‘žπ‘› + π‘žπ‘›+1 ≀ OPT π‘žπ‘š ≀ π‘žπ‘›+1 π‘žπ‘š ≀ π‘žπ‘›+1 ≀ 1 2 π‘žπ‘› + π‘žπ‘›+1 ≀ OPT 2 ≀ 3 2 β‹… OPT

slide-96
SLIDE 96

LongestProcessingTime (LPT): Sort jobs so that π‘ž1 β‰₯ π‘ž2 β‰₯ β‹― β‰₯ π‘žπ‘œ. For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

  • We have shown LPT has approximation ratio (at most) Ξ€

3 2.

  • By a more careful analysis, it can be shown LPT is actually

a Ξ€ 4 3 approximation algorithm.

  • The problem of β€œminimum makespan on identical machines”

has a PTAS (Polynomial Time Approximation Scheme). βˆ€πœ— > 0, βˆƒpoly-time (1 + πœ—)-approx. alg. for the problem

slide-97
SLIDE 97

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-98
SLIDE 98

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-99
SLIDE 99

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-100
SLIDE 100

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-101
SLIDE 101

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-102
SLIDE 102

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-103
SLIDE 103

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-104
SLIDE 104

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-105
SLIDE 105

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-106
SLIDE 106

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-107
SLIDE 107

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-108
SLIDE 108

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

slide-109
SLIDE 109

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

slide-110
SLIDE 110

Online Scheduling

𝑛 identical machines Jobs arrive (revealed) one-by-one

Schedule decision must be made once a job arrives, without seeing jobs in the future.

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

LPT is not an

  • nline alg. for

scheduling.

slide-111
SLIDE 111

Competitive Analysis

The competitive ratio of an online algorithm 𝒝 is 𝛽 if:

For every possible input sequence 𝐽 of the considered problem: solution value returned by online alg. 𝒝 on 𝐽 solution value returned by optimal offline alg. on 𝐽 ≀ 𝛽

slide-112
SLIDE 112

Competitive Analysis

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

The competitive ratio of an online algorithm 𝒝 is 𝛽 if:

For every possible input sequence 𝐽 of the considered problem: solution value returned by online alg. 𝒝 on 𝐽 solution value returned by optimal offline alg. on 𝐽 ≀ 𝛽

slide-113
SLIDE 113

Competitive Analysis

List (Graham 1966): For each job π‘˜ = 1,2, β‹― , π‘œ do: Assign job π‘˜ to a currently least loaded machine.

The competitive ratio of an online algorithm 𝒝 is 𝛽 if:

For every possible input sequence 𝐽 of the considered problem: solution value returned by online alg. 𝒝 on 𝐽 solution value returned by optimal offline alg. on 𝐽 ≀ 𝛽

List is a 2-competitive online algorithm