Approximation Algorithms
Greedy and Local Search
Advanced Algorithms Nanjing University, Fall 2018
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
Advanced Algorithms Nanjing University, Fall 2018
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
π2 π3 π1 π2 π3 π4 π5 π1 π4 π
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
π2 π3 π1 π2 π3 π4 π5 π1 π4 π
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
π2 π3 π1 π2 π3 π4 π5 π1 π4 π
21 NP-complete problems.
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
π2 π3 π1 π2 π3 π4 π5 π1 π4 π
21 NP-complete problems.
solutions efficiently?
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 π·.
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 π½
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(π½) β€ π½
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
GreedyCoverοΌ Set π· = β . While π β β do: Add π with largest |ππ β© π| to π·. Set ππ πππ π =
1 |ππβ©π| for all π β ππ β© π.
π = π β ππ. Return π·.
Ξ€ OPT(π½) π.
Ξ€ OPT(π½) π.
that the price of its uncovered elements is at most Ξ€ OPT(π½π’) (π β π) β€ Ξ€ OPT(π½) (π β π).
Ξ€ 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
ππ πππ = Ξ€ 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 π·.
ππ πππ = Ξ€ 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 π·.
ππ πππ = Ξ€ 1 3 ππ πππ = Ξ€ 1 3 ππ πππ = Ξ€ 1 3
π2 π3 π1 π2 π3 π4 π5 π1 π4
ππ πππ = 1 ππ πππ = 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 π·.
ππ πππ = Ξ€ 1 3 ππ πππ = Ξ€ 1 3 ππ πππ = Ξ€ 1 3
π2 π3 π1 π2 π3 π4 π5 π1 π4
ππ πππ = 1 ππ πππ = 1
ln(π)
algorithm unless NP = P.
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 π·.
Instance: Given a collection of subsets π1, π2, β― , ππ β π, find the smallest π· β [π] such that Ϊπβπ· ππ = π.
π2 π3 π1 π2 π3 π4 π5 π1 π4 π
# of subsets the element is in.
π½ to denote the frequency
instance π½.
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
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
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
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
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
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
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
Instance: A collection of subsets π1, π2, β― , ππ β π. Set Cover: Find smallest π· β [π] such that Ϊπβπ· ππ = π.
What if the frequency of each element is exactly 2?
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: 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. βπ β πΉ: π β© π· β β .
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. βπ β πΉ: π β© π· β β .
π€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
π€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
π€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
π identical machines
π identical machines π jobs processing time ππ 6 1 4 2 3 3 5 2 4 3
π machines π jobs each with processing time ππ
Completion time:
(of machine π)
π·π = ΰ·
π: jobs assigned to machine π
ππ
π machines π jobs each with processing time ππ
Completion time:
(of machine π)
Makespan: π·π = ΰ·
π: jobs assigned to machine π
ππ
π·max = max
π
π·π
π machines π jobs each with processing time ππ makespan
Instance: π jobs π = 1,2, β― , π each with processing time ππ β β€+. Problem: Find a schedule assigning π jobs to π identical machines so as the minimize the makespan.
Instance: π jobs π = 1,2, β― , π each with processing time ππ β β€+. Problem: Find a schedule assigning π jobs to π identical machines so as the minimize the makespan.
machines could be different, jobs could have release-dates/deadlines, etcβ¦
Instance: π jobs π = 1,2, β― , π each with processing time ππ β β€+. Problem: Find a schedule assigning π jobs to π identical machines so as the minimize the makespan.
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 Οπβπ΅ π¦π = ΟπβπΆ π¦π.
Instance: π jobs π = 1,2, β― , π each with processing time ππ β β€+. Problem: Find a schedule assigning π jobs to π identical machines so as the minimize the makespan.
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 Οπβπ΅ π¦π = ΟπβπΆ π¦π.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs each with processing time ππ
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
This algorithm finishes within poly-time.
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?
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
π
ππ
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 β₯ ΰ·
π
ππ
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 π.
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 = π·π = π·π β ππ + ππ
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
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 π
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
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
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 π ΰ·
π
ππ β ππ π
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
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 π.
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.]
Start with an arbitrary solution: Keep making improvements by locally adjusting the solution, until no further improvement can be made (local optimum)
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 π.
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 π.
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 π.
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 π.
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!)
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?
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 β₯ ΰ·
π
ππ
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 β₯ ΰ·
π
ππ
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 = π·π = π·π β ππ + ππ
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
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 π ΰ·
π
ππ β ππ π
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 π)
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οΌ 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
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!
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
π identical machines π jobs
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
π identical machines π jobs
List (Graham 1966)οΌ For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
LongestProcessingTime (LPT)οΌ Sort jobs so that π1 β₯ π2 β₯ β― β₯ ππ. For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
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?
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 = π·π = π·π β ππ + ππ
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
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
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., π > π)
Otherwise, LPT returns an optimal solution already!
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., π > π)
Otherwise, LPT returns an optimal solution already! ππ + ππ+1 β€ OPT
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., π > π)
Otherwise, LPT returns an optimal solution already! ππ + ππ+1 β€ OPT ππ β€ ππ+1
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., π > π)
Otherwise, LPT returns an optimal solution already! ππ + ππ+1 β€ OPT ππ β€ ππ+1 ππ β€ ππ+1 β€ 1 2 ππ + ππ+1 β€ OPT 2
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., π > π)
Otherwise, LPT returns an optimal solution already! ππ + ππ+1 β€ OPT ππ β€ ππ+1 ππ β€ ππ+1 β€ 1 2 ππ + ππ+1 β€ OPT 2 β€ 3 2 β OPT
LongestProcessingTime (LPT)οΌ Sort jobs so that π1 β₯ π2 β₯ β― β₯ ππ. For each job π = 1,2, β― , π do: Assign job π to a currently least loaded machine.
3 2.
a Ξ€ 4 3 approximation algorithm.
has a PTAS (Polynomial Time Approximation Scheme). βπ > 0, βpoly-time (1 + π)-approx. alg. for the problem
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π identical machines Jobs arrive (revealed) one-by-one
Schedule decision must be made once a job arrives, without seeing jobs in the future.
π 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.
π 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
scheduling.
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 (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 (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