the dynamic single file allocation problem martina terbahl

35
The Dynamic Single File Allocation Problem Martina Terbahl

Upload: amalie-gawron

Post on 05-Apr-2015

146 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem

Martina Terbahl

Page 2: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 2

Inhalt

Einführung

Single FAP / Dynamic FAP

primale Heuristik

Branch & Bound

Berechnungsergebnisse

Page 3: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 3

Einführung

Dynamic Single File Allocation Problem in Verteilten Rechensystemen

Informationen müssen nicht zentral gespeichert werden

Problem: Wo werden die Dateien am kostengünstigsten gespeichert?

Page 4: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 4

Single FAP (1)

gegeben: Netzwerk-TopologieWege zwischen 2 Knoten liegen eindeutig fest

gesucht:Anzahl der Kopien einer Datei im SystemPlatz, an dem jede Kopie plaziert werden soll,

um die Gesamtoperationskosten zu minimieren

Page 5: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 5

Single FAP (2)

Operationskosten bestehen aus:Kosten einer Anfrage

Kommunikationskosten zwischen Benutzer- und Dateiknoten

Aktualisierung einer DateiZugriff und Aktualisierung jeder Kopie der Datei

Aktualisierungskosten können für jede Kopie einer Datei festgelegt werden

Abspeicherung einer Datei

Page 6: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 6

Single FAP (3)

Bedingung: Anfragen und Aktualisierungen treten regelmäßig auf

Die meisten heutigen Systeme sind aber dynamisch

Anfrage- und Aktualisierungsraten ändern sich während der Zeit

Page 7: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 7

Dynamische Systeme

Unterscheidung von 3 unterschiedlichen SystemenWachstum und Rückgang der Anfragen bzw.

Aktualisierungen sind voraussagbarWachstum und Rückgang sind saisonbedingt:

Änderungen wiederholen sich in gleichen IntervallenJedes Intervall ist aufgeteilt, wobei jeder Teil

unterschiedliche Anfrage- und Aktualisierungsraten hat

anhand historischer Daten sind hier Wachstum und Rückgang voraussagbar

Wachstum und Rückgang sind zufällig und damit nicht voraussagbar

Page 8: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 8

Dynamic FAP (1)

Hier: Betrachtung von saisonbedingten Wachstum

und RückgangBetrachtung einer einzelnen Datei

Für jede Periode werden die Dateien neu zugewiesen

Operationskosten werden über einen ausgedehnten Zeitraum minimiert

Page 9: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 9

Dynamic FAP (2)

Anfrage- und Aktualisierungskosten sind vor jeder Saison bekannt

beinhaltet Startkosten

optimal über den betrachteten Zeitraum

deterministisch

Page 10: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 10

Startkosten

Kosten, die in einer Periode auftreten, wenn eine Kopie an einen Knoten kopiert wird, in der in der Vorperiode keine Kopie war

besteht aus:Setup-KostenÜbertragungskosten, wenn die Datei von einer

anderen Stelle verschoben oder kopiert wird

werden als fixe Kosten für jeden Knoten angenommen und sind vorher bekannt.

Page 11: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 11

DFAP Zielfunktion

itTt Ii

iitTt Ii

itijtTt Ii Jj

ijt zFyfxcZ

min

gesamte Anfrage-Kosten: Cijt: Anfrage-Übertragungs-Kosten von i nach j in Periode t xijt: Anteil der Anfrage von j, den i erfüllt

gesamte Update-/Speicher-Kosten: fit: gesamte fixe Kosten in i in Periode t

ity1 falls Kopie in i existiert

0 sonst

gesamte Start-Kosten: Fi: Start-Kosten in i

itz1 falls Start-Kosten in i

0 sonst

Page 12: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 12

Nebenbedingungen (1)

Anfrage jedes Benutzers muß komplett erfüllt werden.

Wenn ein Knoten keine Datei bzw. Kopie enthält, kann er auch keine Anfrage erfüllen.

TtJjIixIi

ijt

,,1 (1)

1, tIiyx itijt(2)

Page 13: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 13

Nebenbedingungen (2)

stellt die Start-Kosten in t sicher, wenn in t-1 keine Datei-Kopie vorhanden war

1\,

1,

1

11

TtIiyyz

tIiyyz

ititit

ipii

(3a)

(3b)

TtIizy

TtJjIix

itit

ijt

,1,0,

,,0 (4)

(5)

Page 14: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 14

Überblick

primale Aufgabe (P)

duale Aufgabe (D)

Unterproblem (SD) Hauptproblem (MD)

(SD1) (SD2)

...

... (SDs)

Page 15: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 15

Exkurs: Dualität (1)

Definition:Zu einer gegeben primalen Aufgabe:

Minimiere Zp=cTx u.d.N. Ax=b; x0

heißt die dazugehörige duale Aufgabe: Maximiere Zd=bT u.d.N. AT cT

Speziell gilt für die optimale Lösung: cTx = bT

Satz vom komplementären Schlupf:x ist optimal, wenn (cT - TA)x = 0

Vorteil: weniger Restriktionen

Page 16: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 16

Exkurs: Dualität (2)ZP

ZD

LPP

LPD

Page 17: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 17

Primales DFAP Model (Wdh.)

itTt Ii

iitTt Ii

itijtTt Ii Jj

ijt zFyfxcZ

min

u.d.N.

1,0,

0

1

1

11

itit

ijt

ititit

ipii

itijt

Iiijt

zy

x

yyz

yyz

yx

x

TtIi

TtJjIi

TtIi

tIi

TtJjIi

,

,,

1\,

1,

,,

TtJj , (1)

(2)

(3a)

(3b)

(4)

(5)

Page 18: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 18

Duales DFAP Model

Jj Tt

jtmax

u.d.N.

0,0

1

itijt

iit

ijtijtjt

itititJj

ijt

F

c

f

TtJjIi

TtIi

TtJjIi

,,

,

,,

TtIi ,

aus (1) abgeleitetaus (2) abgeleitet

aus (3a), (3b) abgeleitet

Page 19: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 19

Überblick

primale Aufgabe (P)

duale Aufgabe (D)

Unterproblem (SD) Hauptproblem (MD)

(SD1) (SD2)

...

... (SDs)

Page 20: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 20

Unterproblem - Hauptproblem

Jj Tt

jtmax

u.d.N.

0,0

1

itijt

iit

ijtijtjt

itititJj

ijt

F

c

f

TtJjIi

TtIi

TtJjIi

,,

,

,,

TtIi ,

Jj Tt

jtDZ max)(

u.d.N.

0

1

ijt

ijtijtjt

itititJj

ijt

c

f

TtJjIi ,,

TtIi ,

TtJjIi ,,

Unterproblem

)(DZ

u.d.N. iit F0 TtIi ,maxHauptproblem

Page 21: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 21

Überblick

primale Aufgabe (P)

duale Aufgabe (D)

Unterproblem (SD) Hauptproblem (MD)

(SD1) (SD2)

...

... (SDs)

Page 22: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 22

Aufteilung des Unterproblems

Sei p die Anzahl der Perioden

Das Unterproblem (SD) wird in ein einzelnes Problem (SDt) für jede Periode aufgeteilt

p Probleme, die sich schnell lösen lassen

Page 23: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 23

Überblick

primale Aufgabe (P)

duale Aufgabe (D)

Unterproblem (SD) Hauptproblem (MD)

(SD1) (SD2)

...

... (SDs)

Page 24: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 24

LPD

Hauptproblem (MD) (1)

)(DZ

u.d.N. iit F0 TtIi ,max

ZP

ZD()

IPP

Page 25: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 25

Hauptproblem (MD) (2)

Ziel: finde optimales

Führe push-flow durch, falls die komplementären Schlupfbedingungen nicht erfüllt sind.

Page 26: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 26

Push-Flow

ausgehend von i wird ein Knoten it mit positiven Schlupf gesucht

i-1

iitsit

Der Schlupf bzw. ein Teil vom Schlupf wird von it wird nach i geschoben und damit die ‘s verkleinert bzw. erhöht

i verletzt die komplementären Schlupfbedingungen

Page 27: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 27

Nested Dual Ascent Procedure (1)

3 a) Für jeden Knoten Falls der komplementäre Schlupf nicht erfüllt ist, dann führe einen push-flow aus.

'i

1 a) it 0

2 1

b) führe das Unterproblem für jede Periode aus und berechne { } und

und daraus { } und . ; Falls STOP

jt

DZititijt zyx ,,

PZ PP ZZ * *PD ZZ

Page 28: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 28

Nested Dual Ascent Procedure (2)

3 b) Falls ein verbesserndes gefunden wurde gehe zu 4 sonst zu 5

4 a) Führe das Unterproblem (SD) aus und berechne

{ } und und daraus { } und neu. j

DZ

ititijt zyx ,, PZ

b) Falls dann*PP ZZ PP ZZ *

Page 29: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 29

Nested Dual Ascent Procedure (1)

4 c) Falls dann STOP *PD ZZ

5 Falls p dann +1 und gehe zu 3 sonst, falls in den letzten p Perioden keine Verbesserung gefunden wurde dann STOP sonst gehe zu Schritt 2

Page 30: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 30

Überblick

primale Aufgabe (P)

duale Aufgabe (D)

Unterproblem (SD) Hauptproblem (MD)

(SD1) (SD2)

...

... (SDs)

Page 31: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 31

Primale Heuristik

Verbesserung des Ergebnisses durch Add-Drop Heuristik

Add-Prozedur falls in i komplementäre Schlupfbedingungen

verletzt werden, wird an i-1 eine Kopie eingefügt

Drop-Prozedur falls in i komplementäre Schlupfbedingungen

verletzt werden, wird an i eine Kopie gelöscht

Beide Prozeduren werden auf jeden Knoten ausgeführt. Diejenige, die das bessere Ergebnis liefert, wird übernommen.

Page 32: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 32

Branch & Bound

DFS untere Schranke liefert das duale Problem obere Schranke liefert dementsprechend

das primale Problem der Baum entwickelt sich anhand der yit-

Variablen, die den komplementären Schlupf am meisten verletzen

Der Zweig, für die yit = 0 gesetzt wird, wird als erstes betrachtet

Page 33: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 33

Berechnungsergebnisse (1)

implementiert in FORTRAN gerechnet auf IBM 3090-600E getestet wurden Beispiele zwischen 10

und 30 Knoten mit 2 bis 6 Perioden Die Differenz zwischen primalem und

dualem Ergebnis lagen zwischen 2,3 % und 14,2 %

Die Differenz zwischen dualem Ergebnis und optimalen Ergebnis lag zwischen 0,3 % und 2,3 %

Page 34: The Dynamic Single File Allocation Problem Martina Terbahl

The Dynamic Single File Allocation Problem 34

Berechnungsergebnisse (2)

Die Berechnung mit primaler Heuristik benötigte zwischen 0,011 und 1,39 Sekunden

Vergleich mit dem bekannten Algorithmus MPSX/MIP/370bis zu 100 mal schneller als MPSXJedes Problem in max. 110 Sekunden gelöst,

während MPSX bei größeren Problemen mehr als 20 Minuten brauchte

Fazit: Das Verfahren löst das DSFAP in einer Zeit, die auch in der Praxis anwendbar ist.

Page 35: The Dynamic Single File Allocation Problem Martina Terbahl

Ende