1 / 40

אלגוריתמים מבוזרים א'

אלגוריתמים מבוזרים א'. שמואל זקס zaks@cs.technion.ac.il , www.cs.technion.ac.il/~zaks. A. Distributed algorithms. Example 1: synchony. 9. 8. 7. 6. 5. 4. 3. 2. 1. 8 days, 1 professor. 4 days, 2 professor . Exercise: find a trade-off between no. of days and no. of professors.

hunter
Download Presentation

אלגוריתמים מבוזרים א'

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. אלגוריתמים מבוזרים א' שמואל זקס zaks@cs.technion.ac.il, www.cs.technion.ac.il/~zaks

  2. A. Distributed algorithms Example 1: synchony 9 8 7 6 5 4 3 2 1 8 days, 1 professor 4 days, 2 professor Exercise: find a trade-off between no. of days and no. of professors.

  3. Example 2: leader election x x 4 8 ? x x 5 6 9 Exercise: find a better algorithm to find the maximum, prove correctness and analyze performance.

  4. Example 3: faults Impossibility of consensusThe Byzantine Generals Problem

  5. Example 4: snapshot

  6. B. Self Stabilization Example 5: self stabilization 6 7 6 7 6 7 6 7 6 7

  7. 6 7 6 6 4 Exercise: find an algorithm to do it, prove correctness, analyze performance.

  8. C. Networks (optical) כדור 2-ממדי ברדיוס 3: Example 6: layout sp(2,3)= 25

  9. כדור 2-ממדי ברדיוס 1 כדור 1-ממדי ברדיוס 2 sp(2,1)= sp(1,2)= 5 Exercise: prove: sp(x,y)= sp(y,x)

  10. lightpaths Valid coloring p1 p2

  11. Saving a switch:

  12. colors=3 switches = 7 colors = 2 switches = 8

  13. w/ grooming g=2 colors=3 switches=10 colors=2 switches=9

  14. Example 7: min ADMs #ADMs=12 #ADMs=9 Liverpool, 10/10

  15. Coloring of acircular arc graph Liverpool, 10/10

  16. Coloring of a circular arc graph Input: circular arc graph G, k>o. Output: can the arcs be colored with ≤ k colors? G minADM Input: a graph, a set of lightpaths, t>o. Output: can the lightpath be colored such that #ADMs ≤ t ? Liverpool, 10/10

  17. N lightpaths cycles chains #ADMs = N + #chains Cycles are good, chains are bad Liverpool, 10/10

  18. 2.4 cost vs. saving N lightpaths cost(S) = N + chains=13+6=19 • Every chain costs 1 ADM cost(S) = 2N-savings=26-7=19 • Every connection saves 1 ADM N=13 Liverpool, 10/10

  19. Example: D0(S) – lightpath not sharing any ADM D1(S) – lightpath sharing ONE ADM D2(S) – lightpath sharing BOTH ADMs N=25 lightpaths d0(S) = 2 d1(S) = 4 #ADMs=29 d2(S) = 19 d0(S) +d1(S)+d2(S)= 25 = N Liverpool, 10/10

  20. N=25 suppose #chains(S*)=2, cost(S*)=25+2=27 d0(S) = 2 d2(S) = 19 Liverpool, 10/10

  21. Solution S=chains + cycles #ADMs = N + #chains S – ALG, S* - OPT Liverpool, 10/10

  22. We define: and get Liverpool, 10/10

  23. Example 8: min ADMs w/grooming g=2 #ADMs=9 #ADMs=8 Liverpool, 10/10

  24. 2.2 approximation ratio ALG  2N N  OPT ALG  2 xOPT N: # of lightpaths ALG: #ADMs used by the algorithm OPT: #ADMs used by an optimalsolution Liverpool, 10/10

  25. Example 9: min regenerators d=2 3. Regenerators Liverpool, 10/10

  26. Assume that an optimal solution S* savesx ADMs, and a solution S savesy ADMs Liverpool, 10/10

  27. Proof: Optimal solution S* savesx ADMs a solution S savesy ADMs Liverpool, 10/10

  28. On-line problem • Input arrives one at a time, and a decision is made (and cannot be changed). • In the minADM problem: lightpaths arrive one at a time, and need to be colored. • Competitive analysis • An on-line algorithm A is c-competitive if A(I) c OPT(I) for any input sequence I. (A(I) and OPT(I) are #ADMs used by A and by an optimal offline algorithm OPT.) Liverpool, 10/10

  29. ALG ≥ 7/4,even for a ring ALG: ADM=7 OPT: ADM=4 ALG ≥ 7/4 Liverpool, 10/10

  30. Any algorithm ≥ 7/4 , even for a ring Case a: 7/4=1.75 Liverpool, 10/10

  31. Case b: Case b1: 6/3 = 2 Case b2: 5/3 = 1.67 any algorithm ≥ 1.67 We prove: any algorithm ≥ 1.75- Liverpool, 10/10

  32. any algorithm for a path ≥ 3/2 k paths k=12 x=6 k-1 spaces: x between same color k-1-x between different colors Liverpool, 10/10

  33. So far: any algorithm uses 2k ADMs now – a short path at each gap of diffferent colors (k-1-x such gaps) k=12, x=6, 12-1-6=5 Any algorithm uses at least one more ADM for each (ALG uses exactly one) So: any algorithm ≥2k + (k-1-x) ADMs Liverpool, 10/10

  34. So far: use ≥2k + (k-1-x) ADMs now – two long paths at each of the k gap of same color Any algorithm must use 2 ADMs for each So: any algorithm ≥2k + (k-1-x) + 4x = =3k+3x-1 ADMs Liverpool, 10/10

  35. We showed: any algorithm uses ≥ 3k+3x-1 ADMs OPT: the short paths ≤ 2k ADMs for the long paths 2x ADMs OPT 2k+ 2x any algorithm/OPT  3/2 – 1/(2k) Liverpool, 10/10

  36. 3.7 ALG for a path ≤ 3/2 Optimal solution S* savesx ADMs Our solution S savesy ADMs ≤ -> ≤ We show that ≤ ≤ Liverpool, 10/10

  37. set A = 3 set B = 1 d=2 g=1 Liverpool, 10/10

  38. set A andset B = 4 d=2 g=1 Liverpool, 10/10

  39. set A orset B = 3 d=2 g=1 Liverpool, 10/10

  40. 2.6 a useful tool D0(S) – lightpath not sharing any ADM D1(S) – lightpath sharing ONE ADM D2(S) – lightpath sharing BOTH ADMs N=25 lightpaths d0(S) = 2 d1(S) = 4 d2(S) = 19 d0(S) +d1(S)+d2(S)= 25 = N Liverpool, 10/10

More Related