1 / 62

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems. Spring 2009 Prof. Jennifer Welch. Lecture 15. Topic: Link Reversal Sources: Gafni & Bertsekas Busch et al. Charron-Bost et al. Park & Corson MIT 6.885 Fall 2008 slides. directed spanning tree. direct all the links.

sen
Download Presentation

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems

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. CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch

  2. Lecture 15 • Topic: • Link Reversal • Sources: • Gafni & Bertsekas • Busch et al. • Charron-Bost et al. • Park & Corson • MIT 6.885 Fall 2008 slides Discrete Algs for Mobile Wireless Sys

  3. directed spanning tree direct all the links red node is sink reverse red link Motivation for Link Reversal • Assume communication channels in the system can be modeled as an undirected graph (i.e., bidirectional links) • Link reversal algorithms impose logical directions on the edges (or links) of the graph; at certain times the directions on some edges are reversed to achieve some goal. • Example: Suppose goal is to send info to a distinguished node D. Discrete Algs for Mobile Wireless Sys

  4. Outline • Gafni & Bertsekas (1981) introduced “link reversal” algorithms for constructing and maintaining paths to a destination node and proved their correctness. • Busch, Surapaneni & Tirthapura (2003) analyzed the complexity of the GB link reversal algorithms --- worst-case time and work. • Charron-Bost, Gaillard, Welch & Widder (2008) gave a more fine-grained analysis of work complexity for a more general algorithm. • Park & Corson (1997) modified the GB “partial reversal” algorithm to detect when nodes are partitioned from the destination --- result is the Temporally Ordered Routing Algorithm (TORA) for MANETs. Discrete Algs for Mobile Wireless Sys

  5. Motivation [GB] • Network contains a distinguished “central station”. • Central station collects information from other nodes via “contingency routes”. • Construct contingency routes that • provide redundant routes to station • are loop-free • don’t require flooding • rely only on local information Discrete Algs for Mobile Wireless Sys

  6. D D 2 2 1 1 Abstract Graph Problem Definition: a directed acyclic graph (DAG) with a distinguished node D is destination-oriented if D is the one and only sink in the graph. Problem statement: Given a DAG with distinguished node D that is not destination-oriented, convert it into a destination-oriented DAG by reversing the directions of some of the links. Discrete Algs for Mobile Wireless Sys

  7. Full Reversal Algorithm • Whenever a node is a sink (but not the destination), reverse all its incident links, i.e., all its incident links become outgoing • Assuming perfect knowledge of state of the link and ability to instantaneously change it • some other algorithms relax this assumption Discrete Algs for Mobile Wireless Sys

  8. D D D 1 2 3 1 2 3 1 2 3 4 5 6 4 5 6 4 5 6 D D D 1 2 3 1 2 3 1 2 3 4 5 6 4 5 6 4 5 6 Full Reversal Algorithm Example Discrete Algs for Mobile Wireless Sys

  9. Implementation of Full Reversal Agorithm: The Pair Algorithm • Each node i keeps a pair (a,i), where a is an integer; pair is called height • Link between two nodes is considered to be directed from node with higher height to node with lower height • At each iteration, if a node i has no outgoing links, then set a to 1 greater than the maximum a-value of all of i’s neighbors at the previous iteration. Discrete Algs for Mobile Wireless Sys

  10. (0,0) (0,0) (0,0) D D D (0,1) (0,2) (0,3) (0,1) (0,2) (0,3) (1,3) (0,1) (0,2) 1 2 3 1 2 3 1 2 3 4 5 6 4 5 6 4 5 6 (0,4) (0,5) (0,6) (0,5) (0,6) (0,4) (0,4) (0,6) (0,5) (0,0) (0,0) D (0,0) D D (0,1) (3,3) (2,2) (2,2) (3,3) (0,1) 1 (0,1) (1,3) 2 3 (2,2) 1 2 3 1 2 3 4 5 6 4 5 6 (0,4) 4 5 6 (2,6) (4,4) (3,5) (4,6) (0,4) (3,5) (2,6) (0,5) Pair Algorithm Example Discrete Algs for Mobile Wireless Sys

  11. Partial Reversal Algorithm • Try to reduce the number of link reversals by having a sink node reverse only some of its incident links. Whenever a node is a sink (but not the destination): reverse all incoming links that have not been reversed since last time this node did a reversal Discrete Algs for Mobile Wireless Sys

  12. D D D 1 2 3 1 2 3 1 2 3 4 5 6 4 5 6 4 5 6 D D D 1 2 3 1 2 3 1 2 3 4 5 6 4 5 6 4 5 6 Partial Reversal Algorithm Example Discrete Algs for Mobile Wireless Sys

  13. "Implementation" of Partial Reversal Algorithm: The Triple Algorithm • Use a triple (a,b,i) for the height. • At each iteration, if a node i has no outgoing links, then, using the neighbors’ heights from the previous iteration, • set a to 1 greater than the minimum a-value of any neighbor • set b to 1 less than the smallest b-value of all neighbors with the new a-value (if no such neighbor then don’t change b) • Why does this implement partial reversal? Discrete Algs for Mobile Wireless Sys

  14. (0,0,0) (0,0,0) (0,0,0) D D D (0,5,1) (0,2,2) (0,1,3) (0,5,1) (0,2,2) (1,1,3) (0,2,2) 1 2 3 1 1 2 3 2 3 (0,5,1) (0,1,3) 4 5 6 4 5 6 4 5 6 (0,4,4) (0,3,5) (0,2,6) (0,4,4) (0,3,5) (0,2,6) (0,4,4) (0,3,5) (0,2,6) (0,0,0) (0,0,0) (0,0,0) D D D (0,5,1) (1,0,2) (1,1,3) (0,5,1) (1,0,2) (1,1,3) (0,5,1) (1,0,2) (1,1,3) 1 1 2 3 2 3 1 2 3 4 5 6 4 5 6 4 5 6 (1,-2,4) (1,-1,5) (1,0,6) (0,4,4) (1,-1,5) (1,0,6) (0,4,4) (0,3,5) (1,0,6) Triple Algorithm Example Discrete Algs for Mobile Wireless Sys

  15. Analysis of Link Reversal Algorithms • [GB] proved correctness of a general class of algorithms that includes the full and partial reversal algorithms: Every algorithm in the class terminates in a finite number of iterations with a destination-oriented DAG. Discrete Algs for Mobile Wireless Sys

  16. [GB] Correctness Proof • Define an abstraction of the heights: taken from a set A that is • countable infinite • totally ordered • partitioned into n disjoint subsets, one per node (other than D), s.t. • each subset is countably infinite and unbounded • there is an operator on each subset under which it is an Abelian group • Link (i,j) is considered to be directed from node i to node j if ai is larger than aj in the total order Discrete Algs for Mobile Wireless Sys

  17. General Algorithm [GB] • Given a vector v = (v1, v2, …, vn), where vi is the (generalized) height of node i, algorithm M has these properties: • M(v) is a set of vectors (nondeterministic) • if no sinks in v, then M(v) is empty • for each v' in M(v): • either v'i = vi • or v'i = gi(vi) (only allowed if node i is a sink in v) • gi(vi) > vi and depends only on heights in v of node i and i's neighbors • some unbounded increase condition for gi (A3) Discrete Algs for Mobile Wireless Sys

  18. Why Nondeterminism? • Execution of algorithm is a sequence of vectors, starting with some initial assignments of heights, where each vector v' in the sequence is contained in M(v), where v is the preceding vector • If there is one or more sinks in the graph, then at each step, one or more of the sinks can take a step • timing and order of steps is immaterial • captures asynchronous execution Discrete Algs for Mobile Wireless Sys

  19. Correctness of General Algorithm • Acyclic: follows because the heights are totally ordered • Proposition 1: algorithm terminates in a finite number of iterations (no sinks, other than the destination D) • since acyclic and no sinks, every node has a directed path to D • Proposition 2: once a node has a directed path to D, it is never is a sink Discrete Algs for Mobile Wireless Sys

  20. Complexity of Link Reversal Algorithms • [GB] proved correctness of a general class of algorithms that includes the full and partial reversal algorithms: Every algorithm in the class terminates in a finite number of iterations with a destination-oriented DAG. • But how many iterations? I.e., what is the complexity? Discrete Algs for Mobile Wireless Sys

  21. [BST, BT] Complexity Results Worst case bounds better • time = number of iterations with maximum concurrency • work = number of link reversals • n = number of nodes with no path to destination • a* = max a – min a in initial state Discrete Algs for Mobile Wireless Sys

  22. Counting Reversals • Both examples had all sink nodes reversing in parallel at each iteration. • [GB], and [BST,BT], show that the order in which reversals are done is immaterial -- resulting DAG is always the same. • [BST,BT] proof uses notion of a dependency graph of reversals: • number of node reversals is number of vertices in dependency graph • time is at least the depth of the dependency graph Discrete Algs for Mobile Wireless Sys

  23. Upper Bounds • Pair algorithm: [BST,BT] prove that each node reverses at most n times, implying • O(n2) reversals • taking O(n2) time (if sequential) • Triple algorithm: [BST,BT] prove that each node reverses at most a* + n times, so • O(n a* + n2) reversals • taking O(n a* + n2) time (if sequential) Discrete Algs for Mobile Wireless Sys

  24. D 1 2 n -1 n D 1 2 n/2 n -1 n n/2+1 n/2+2 Lower Bounds for Pair Algorithm Bad graph for work: node i does i reversals => W(n2) reversals Bad graph for time: [BST,BT] prove each node in right half of chain reverses n/2 times. These reversals must be sequential since neighbors cannot be sinks simultaneously =>W(n2) time. Discrete Algs for Mobile Wireless Sys

  25. D 1 2 n -1 n n/2+1 n/2+2 D 1 2 n/2 n n -2 n -1 Lower Bounds for Triple Algorithm Bad graph for work (links alternate direction): [BST] prove node i reverses Q(a* + i) times => W(na* + n2) reversals Bad graph for time: [BST] prove each node in the red oval reverses W(a* + n) times. These reversals must be sequential since neighbors cannot be sinks simultaneously =>W(na* + n2) time. Discrete Algs for Mobile Wireless Sys

  26. Some Additional Questions • What about the original, abstract, full and partial reversal algorithms? • not hard to show that the pair algorithm implements full reversal • not at all straightforward to see that the triple algorithm implements partial reversal • Are unbounded counters necessary for doing link reversal? • Is the generalized height approach useful for developing alternative algorithms, or would some other formalism be better? • Can we find the exact expression for the time and work complexity of link reversal algorithms for any node and in any graph? Discrete Algs for Mobile Wireless Sys

  27. [CGWW] • New formulation of FR and PR using only binary labels on the links • Simple distributed algorithm for finding routes in acyclic graphs • Identify sufficient conditions on initial labeling for correctness • FR and PR are special cases • Easy to state new algorithms (use different initial labelings) • Much simpler proof of correctness • first known proof that PR preserves acyclicity Discrete Algs for Mobile Wireless Sys

  28. LR Algorithm Schema • Input is a directed acyclic graph G* with • distinguished node D • each link labeled with 0 ("unmarked) or 1 ("marked") • while there exists a sink v ≠ D do: if v has an incident unmarked link then reverse all incident unmarked links flip the labels on all incident links else // all of v's incident links are marked reverse all incident links // leave them marked LR1: LR2: Discrete Algs for Mobile Wireless Sys

  29. 1 1 0 D LR2 1 1 0 D LR1 1 0 1 D LR2 1 0 1 D LR1 1 1 0 D LR Example Discrete Algs for Mobile Wireless Sys

  30. Special Cases of LR Algorithm • Full Reversal: Initially all labels are 1 • Only ever execute LR2 step • All labels are always 1 • Partial Reversal: Initially all labels are 0 • Execute both LR1 and LR2 • Labels change Discrete Algs for Mobile Wireless Sys

  31. D D 0 D 0 0 0 1 0 1 2 3 1 2 3 1 2 3 0 0 0 0 1 0 4 5 6 4 5 6 0 0 4 5 6 0 0 D 0 D D 0 0 0 1 1 0 0 1 1 2 3 1 2 3 1 1 1 0 2 3 0 0 0 1 0 0 4 5 6 0 0 4 5 6 1 0 4 5 6 0 1 PR Example with LR Discrete Algs for Mobile Wireless Sys

  32. Basic Definitions • Given undirected graph G: • G* is a directed version of G • a chain in G* corresponds to an (undirected) path in G; might not have all links directed the same way • a circuit in G* corresponds to an (undirected) cycle in G; might not form a directed cycle Discrete Algs for Mobile Wireless Sys

  33. u v LR Terminates Theorem:LR terminates. Proof: At least one node takes a finite number of steps (D). Suppose in contradiction at least one node takes an infinite number of steps. finite number of steps infinite number of steps Case 1: After u's last step, link is directed toward u. v cannot become a sink again, contradiction. Discrete Algs for Mobile Wireless Sys

  34. finite number of steps infinite number of steps u u v v finite number of steps infinite number of steps LR Terminates Case 2: After u's last step, link is directed toward v. Case 2.1: After v's next step, link is directed toward u. v cannot become a sink again, contradiction. Discrete Algs for Mobile Wireless Sys

  35. finite number of steps infinite number of steps u u u v v v 0 1 LR Terminates Case 2: After u's last step, link is directed toward v. Case 2.2: After v's next step, link is still directed toward v. Then it must be labeled 0. After v's next step, link is directed toward u (labeled 1). v cannot become a sink again, contradiction. Discrete Algs for Mobile Wireless Sys

  36. LR Preserves Acyclicity Theorem: If LR input is a DAG in which every circuit satisfies a certain condition AC, then every step maintains acyclicity. Theorem: If every node of a DAG has the same label on all its incoming links (a "uniform" labeling), then every circuit satisfies condition AC. Discrete Algs for Mobile Wireless Sys

  37. all binary link labelings maintain acyclicity satisfy condition AC uniform labeling all 0's (PR) all 1's (FR) Comparing Initializations Discrete Algs for Mobile Wireless Sys

  38. What about Complexity of LR? • No systematic study until work of Busch, Surapaneni, and Tirthapura (2003) • They studied work • total number of reversals done by all nodes and time • total number of rounds, assuming maximum concurrency for sinks reversing of [GB]'s pair and triple algorithms • Results were of this form: for every n, there exists a graph with n nodes in which (f(n)) reversals are done / (f(n)) rounds are executed. Discrete Algs for Mobile Wireless Sys

  39. [BST,BT] Bounds Again Worst case bounds • time = number of iterations • work = number of node reversals • n = number of nodes with no path to destination • a* = max a – min a in initial state Discrete Algs for Mobile Wireless Sys

  40. [CGWW] Contributions • Expression for the exact number of steps (work) taken by any node in any graph during the generic algorithm • Expression depends only on the input graph • Has simple formulas when specialized to FR and PR • Exact formula helps in finding best and worst topologies Discrete Algs for Mobile Wireless Sys

  41. Work Complexity Overview • For any node v, define a nonnegative quantity  • Every time v takes a step,  decreases by either 1 or 2 • When other nodes take steps,  is unchanged • Once v has a directed path to D,  = 0 Discrete Algs for Mobile Wireless Sys

  42. D D D D D D D 2 2 1 1 3 4 D Work Complexity Pattern for FR Number of reversals by node v equals number of links directed away from D in the chain to v. Quantity decreases by 1 when v takes a step. Discrete Algs for Mobile Wireless Sys

  43. Work Complexity Overview • Break  into 2 pieces:  =  -  • Show  never changes • Show  increases by either 1 or 2 when v takes a step • Increment depends on a classification of v into one of 3 groups (S, N, or O) • Thus  decreases by either 1 or 2 whenever v takes a step Discrete Algs for Mobile Wireless Sys

  44. Work Complexity Overview • Consider any execution of LR starting with a graph whose circuits all satisfy condition AC. • Let k be initial value of  for node v. Discrete Algs for Mobile Wireless Sys

  45. Work Complexity of FR Corollary: Number of steps taken by v in FR is min, over all chains between v and D, of number of links directed away from D. Worst case graph is chain with all edges directed away from D: total work complexity is n(n+1)/2 Discrete Algs for Mobile Wireless Sys

  46. Work Complexity of PR Corollary: Number of steps taken by v in PR is • min, over all chains b/w v and D, of number of nodes on the chain with two incoming unmarked chain links, if v is a sink or a source • (plus 1 in some cases) • If v is neither a sink nor a source, then the number of steps is twice the above quantity Worst-case graph is chain with links that alternate direction: total work complexity is n2/4+1 (for even n) Discrete Algs for Mobile Wireless Sys

  47. Discussion of [CGWW] • Fresh approach to specify and analyze link reversal algorithms of [GB] • Developed a generalization of the algorithms • bounded space complexity • Exact expression for work complexity of any node in any graph for general algorithm • [BST,BT] work was exact for pair algorithm but not exact for triple algorithm Discrete Algs for Mobile Wireless Sys

  48. Open Question • Time complexity: can we come up with a formula for the last round at which a given node takes a step (assuming all sinks take steps simultaneously at each round)? Discrete Algs for Mobile Wireless Sys

  49. D 1 2 3 D 1 D 1 2 3 2 3 D 1 2 3 Effect of Partitions • The full and partial reversal algorithms work if nodes are not partitioned from the destination. • What happens if they are? • Full reversal: Discrete Algs for Mobile Wireless Sys

  50. Park & Corson, 1997 (TORA) • Temporally Ordered Routing Algorithm • Modify GB partial reversal algorithm for routing messages in mobile ad hoc networks • Use n copies of the link reversal algorithm, one for each possible destination node. • Detect when a node has been partitioned from a destination and stop trying to sending messages to it • Height is a 5-tuple. Discrete Algs for Mobile Wireless Sys

More Related