• No results found

Welcome to the course Algorithm Design

N/A
N/A
Protected

Academic year: 2021

Share "Welcome to the course Algorithm Design"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

Friedhelm Meyer auf der Heide 1

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Welcome to the course

Algorithm Design

Summer Term 2011

Friedhelm Meyer auf der Heide Lecture 6, 20.5.2011

(2)

Friedhelm Meyer auf der Heide 2

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Topics

- Divide & conquer

-

Dynamic programming

-

Greedy Algorithms

- Approximation Algorithms

- Randomized Algorithms

- Online Algorithms

(3)

Friedhelm Meyer auf der Heide 3

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

For which problems are Greedy-Algorithms optimal?

Consider a finite set E and a system U of subsets of E. (E,U) is called a

subset-system, if the following holds: (i) ? 2 U

(ii) For each B 2 U, also each subset of B is in U.

B2 U is called maximal, if no proper superset of B is in U. The Optimization problem corresponding to (E,U) is :

Given a weight function w:E Q+ ,compute a maximal set B 2 U with

maximizes w(B) = §e2 B w(e).

(4)

Friedhelm Meyer auf der Heide 4

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Subset-Systems and the Canonical Greedy-Algorithm

Canonical Greedy ((E,U))

(1) Sort E such that w(e

1

)

¸

¸

w(e

n

).

(2) B

?

.

(3) For k=1 to n

if B

[

{e

k

}

2

U then B B

[

{e

k

}

(4) Return B

(5)

Friedhelm Meyer auf der Heide 5

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Greedy-Algorithms und Matroids

A system of subsets (E,U) is a matroid, if in addition, the following exchange property holds:

(iii) For all A,B 2 U with |A|<|B|, there is x2 B-A such that A[{x} 2 U.

Remark: All maximal sets of a matroid have the same size. (homework)

Theorem: Consider a system of subsets (E,U). Canonical Greedy is optimal for (E,U) for every weight function w, if and only if (E,U) is a matroid.

(6)

Friedhelm Meyer auf der Heide 6

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Matroids and the canonical Greedy Algorithm

Theorem: Consider a system of subsets (E,U). Canonical Greedy is optimal for (E,U) for every weight function w, if and only if (E,U) is a matroid.

Proof:

(: Consider a matroid (E,U) and a weight function w. Let w(e1)¸ …¸ w(en).

- Consider an optimal solution T’={ei1, …, eik}.

- Assume the solution T={ej1, …, ejk} found by Canonical Greedy were not optimal, i.e. w(T’)> w(T).

- Then there is an index p with w(eip) > w(ejp). Let p be minimal with this property. Note that ip < jp, because the items are sorted w.r.t weight. - Apply the exchange property to A = {ej1, …,ejp-1 } and B ={ei1, …, eip } : As |A| < |B|, there is eiq 2 B-A with A [ {eiq} 2 U.

- As w(eiq ) ¸ w(eip) > w(ejp), Canonical Greedy would have chosen eiq before

(7)

Friedhelm Meyer auf der Heide 7

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Matroids and the canonical Greedy Algorithm

Theorem: Consider a system of subsets (E,U). Canonical Greedy is optimal for (E,U) for every weight function w, if and only if (E,U) is a matroid.

Proof:

): Assume that, for some A,B 2 U with |A|<|B|, it holds that A[{e} is not in U, for every e2B-A.

Let |B|=r and consider the weight function w with - w(e) = r+1 for e2A

- w(e) = r for e2B-A - w(e) = 0 else

Then, Canonical Greedy would select a solution T with T µ A and T Å (B-A) =?.

As w(T)=|A|(r+1) · (r-1)(r+1)· r2 -1, T is not optimal, because B is a solution

with larger weight |B|r = r2.

(8)

Friedhelm Meyer auf der Heide 8

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Topics

- Divide & conquer

-

Dynamic programming

-

Greedy Algorithms

-

Approximation Algorithms

- Randomized Algorithms

- Online Algorithms

(9)
(10)

23.05.2011 10

Approximation Algorithms

• Greedy Techniques

– Load-Balancing Problem

– Center Selection Problem

• Pricing Method

– Vertex Cover Problem

• Linear Programming and Rounding

– Vertex Cover Problem

– Generalized Load-Balancing Problem

• Polynomial Time Approximation Scheme

(11)
(12)
(13)

Load Balancing: List Scheduling A D F B C E Machine 3 Machine 2 Time 0 Machine 1 I H J G

(14)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A D F B C E Time 0 I H J G

(15)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A D F B C E Time 0 I H J G

(16)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A D F B C E Time 0 I H J G

(17)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C E Time 0 I H J G D

(18)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C E Time 0 I H J G D

(19)

G

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C E Time 0 I H J D

(20)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C E Time 0 I H J G D

(21)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C E Time 0 I H J G D

(22)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C G E Time 0 I H J G D

(23)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A F B C G E Time 0 I H J D

(24)

Machine 3 Machine 2 Machine 1

Load Balancing: List Scheduling

A D F B C G E 0 I H J Machine 3 Machine 2 Machine 1 A D F B C G E 0 I H J Optimal Schedule List schedule

(25)

23.05.2011 25

1. 2.

(26)
(27)
(28)
(29)
(30)
(31)
(32)
(33)

23.05.2011 33

Approximation Algorithms

• Greedy Techniques

– Load-Balancing Problem

– Center Selection Problem

• Pricing Method

– Vertex Cover Problem

• Linear Programming and Rounding

– Vertex Cover Problem

– Generalized Load-Balancing Problem

• Polynomial Time Approximation Scheme

– Knapsack Problem

(34)
(35)
(36)
(37)
(38)
(39)
(40)

23.05.2011 40

Approximation Algorithms

• Greedy Techniques

– Load-Balancing Problem

– Center Selection Problem

• Pricing Method

– Vertex Cover Problem

• Linear Programming and Rounding

– Vertex Cover Problem

– Generalized Load-Balancing Problem

• Polynomial Time Approximation Scheme

– Knapsack Problem

(41)
(42)
(43)
(44)
(45)
(46)

Friedhelm Meyer auf der Heide 46

HEINZ NIXDORF INSTITUTE

University of Paderborn Algorithms and Complexity

Friedhelm Meyer auf der Heide Heinz Nixdorf Institute

& Computer Science Department University of Paderborn Fürstenallee 11 33102 Paderborn, Germany Tel.: +49 (0) 52 51/60 64 80 Fax: +49 (0) 52 51/62 64 82 E-Mail: [email protected] http://www.upb.de/cs/ag-madh

Thank you for

your attention!

References

Related documents

Further advice on using the tabular method is given in the How to design concrete structures using Eurocode 2: Getting started14 guide in this series..

The aim of our study was firstly to determine whether a retrospective linked data study using routinely collected data was a viable means to compare perinatal and maternal outcomes

The homogenization of Dubrovnik as an international tourist destination has helped to increase economic prosperity within the city, but the Croatian Tourism Board has to focus on

• Overall, about 1.4% of all TV households paid to subscribe to a service in the past year, but currently do not – a similar rate to the past five years. • 5% of

Si respondió “Sí” a una o ambas preguntas, verá el mensaje a continuación. Su estudiante no puede acceder al edificio y debe comunicarse con el director de su estudiante. Repita

If key management resides with the customer, the cloud backup provider must have a process in place to ensure that the encryption key is stored locally with the customer and not

Cognizant Business Consulting developed a structured, proprietary process called the Test Risk Assessment for Project Improvement (TeRAPI), with the main objective

The Manager has contractually agreed to waive fees and/or reimburse the Fund for certain expenses in order to limit “Total Annual Fund Operating Expenses After Fee Waiver and/or