routing and network design: algorithmic issues kamesh munagala duke university
TRANSCRIPT
![Page 1: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/1.jpg)
Routing and Network Design:Algorithmic Issues
Kamesh Munagala
Duke University
![Page 2: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/2.jpg)
Graph Model for the Links
Model sensor nodes as vertices in a graph
Gateway
d(7,8) = “Length” of link
“Length” of link models communication cost per bit“Length” should be a function of #bits being sent (Why?)
![Page 3: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/3.jpg)
Specialized Nature “Geometric Random” graph
• Nodes on a 2D plane• Each node has a fixed communication radius
Correlation Structures:• Spatial Gaussian models• Simple AR(1) temporal models
Assumptions do not always hold!
![Page 4: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/4.jpg)
Unique Features Distributed algorithms:
• Reconfigure routes around failures
• Learning network topology
• Learning correlation structures
• Query processing
Light-weight implementations:• Low compute power and memory
• Limited communication and battery life
• Noisy sensing and transmission
![Page 5: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/5.jpg)
Goals in this Lecture General algorithmic ideas capturing:
• Simplicity and efficiency• Some performance guarantees• Distributed implementations• Low reliance on specific assumptions
Caveats: • Ideas need to be tailored to context• Specialized algorithms might work better
![Page 6: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/6.jpg)
Topics What constitutes good routing?
• Measures of quality
Algorithm design framework• Basic problem statements
• Spanning, shortest path, and Steiner trees
• Aggregation networks
• Location and subset selection problems
• Solution techniques• Types of guarantees on solution quality
Models of information in a sensor network• Tailoring generic algorithms to specific models
![Page 7: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/7.jpg)
Problem 1:Information Aggregation
![Page 8: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/8.jpg)
Routing Tree Problem Statement:
Route information from nodes to gateway Choose subset of edges to route data Edges “connect” all nodes to gateway
• Tree Property
Minimize: Long-term average “cost” of routing Answer will depend on:
• What constitutes “cost”• Correlations in data being collected
![Page 9: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/9.jpg)
Toy Example
66 6
6
1 1 1
Gateway
Each node has 100 bits of information to send to gateway
Value on link (edge) is the cost of transmitting one bit
How should we route the bits?
“Star” network
![Page 10: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/10.jpg)
Depends on Correlations
66 6
6
1 1 1
Gateway
Suppose information is perfectly correlatedInformation from all sources together is also 100 bits!
Spanning tree is optimal
Cost = 100 * (6+1+1+1) = 900 units
Ignore cost of compression
![Page 11: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/11.jpg)
Other Extreme: No Correlation
66 6
6
1 1 1
Gateway
Suppose information is not correlated at allInformation from all sources together is now 400 bits
Shortest path tree is optimal
Cost = 100 * (6+6+6+6) = 2400 units
![Page 12: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/12.jpg)
Had we used a Spanning Tree
66 6
6
1 1 1
Gateway
Suppose information is not correlated at allInformation from all sources together is now 400 bits
Shortest path tree is optimal
Cost = 100 * (6+7+8+9) = 3000 units > 2400 units!
![Page 13: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/13.jpg)
In summary… Moral of the story:
• Choosing good routes is important• Choice depends on correlation structure
Issues to address:• How do we specify correlations
• Simple yet faithful specifications desirable
• Algorithms for finding (near-)optimal routes• Efficient and simple to implement
• Reliability and “backup” routes
![Page 14: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/14.jpg)
There could be nn-2 many spanning trees in general
Exhaustive enumeration is out of question
Minimum Spanning Tree
Cost of MST = 23
10
520
7 15
121
10
520
7 15
121
![Page 15: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/15.jpg)
Spanning Tree Algorithm
“Greedy” schemes add edges one at a time in clever fashionNo backtracking
Kruskal's algorithm: Consider edges in ascending order of cost. Insert an edge unless doing so would create a cycle.
Prim's algorithm: Start with gateway and greedily grow a tree from the gateway outward. At each step, add the cheapest edge that has exactly one endpoint in current tree.
![Page 16: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/16.jpg)
Prim’s Algorithm: Execution10
520
7 15
121
10
520
7 15
121
10
520
7 15
121
10
520
7 15
121
![Page 17: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/17.jpg)
“Distributed” Algorithm?Nodes connect in arbitrary order
Each node simply connects to “closest” existing neighbor
10
520
7 15
121
10
520
7 15
121
10
520
7 15
121
10
520
7 15
121
Cost = 25
![Page 18: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/18.jpg)
Guarantee on “Online” Scheme
n nodes in graph
Cost of “online” tree is within log n factor of cost of MST
Irrespective of order in which nodes join the system!
Intuition: In “star” network, “online” scheme produces MST!
Natural implementation: Greedy starting from gateway
Such a guarantee is called an “approximation guarantee”
![Page 19: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/19.jpg)
Shortest Paths: OSPF
Key algorithmic idea: Greedy local updates
Each node v maintains “tentative” distance d(v) to gateway
Initially, all these distances are infinity
Each node v does a greedy check:
If for some neighbor u, d(v) > d(u) + Length(u,v), then:
Route v through u
Set d(v) = d(u) + Length(u,v)
Run this till it stabilizes
![Page 20: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/20.jpg)
OSPF Execution10
520
7 1
210
10
520
7 1
210
10
520
7 1
210
∞
∞
∞0
10∞
20 2
0 10
2
3
17
710
520
7 1
210
2
3
10
7
![Page 21: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/21.jpg)
Rate of Convergence
n nodes in graph
1. The protocol converges to the shortest path tree
2. The number of rounds till convergence is roughly n
![Page 22: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/22.jpg)
Intermediate CorrelationsOne tree for all correlation values?
Both spanning and shortest path trees at once?
Do-able if we settle for “nearly” optimal trees
In other words, there exists a tree with:
Cost at most thrice cost of MST
Distances to gateway at most twice S.P. distances
![Page 23: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/23.jpg)
Example: MST
nn n
n
1 1 1
Gateway
11 1
n2 nodes
Cost of MST = n2+n
Path length = n2+n
![Page 24: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/24.jpg)
Example: Shortest Path Tree
nn n
n
1 1 1
Gateway
11 1
n2 nodes
Cost = n3
Path Length = n2
![Page 25: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/25.jpg)
Example: Balanced Tree
nn n
n
1 1 1
Gateway
11 1
n nodes
Cost = 2n2
Path Length = 2n
![Page 26: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/26.jpg)
Walk on a Tree
Gateway
![Page 27: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/27.jpg)
Balancing Algorithm
GatewayWalk along Spanning Tree
Add shortcuts to gateway
At node v:
Suppose previous shortcut at u
If SP(u) + Walk(u,v) > 2 SP(v)
Add “shortcut” from v
Walk too long!
Shortcut
![Page 28: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/28.jpg)
Example Revisited
nn n
n
1 1 1
Gateway
11 1
n nodes Walk length = 2n
![Page 29: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/29.jpg)
Proof Idea Final Path Lengths < 2 S.P. Lengths
• Follows from description
Final Cost < 3 MST Cost• Final Cost = MST + Shortest Paths Added• Suppose paths are added at …,u,v… on walk
• SP(u) + Walk(u,v) > 2 SP(v)
• Add these up:• Total Walk Length > Total Length of added Paths
• But, Total Walk Length = 2 MST Cost
![Page 30: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/30.jpg)
Problem 2:Sensor Location
![Page 31: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/31.jpg)
“Most Informative” Placement
Close by locations are not very “informative”
![Page 32: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/32.jpg)
Abstraction Parameters:
• Each node v has communication cost to gateway = cv
• Depends on location
• Subset S of nodes has “information” f(S)• Information is a property of a set of nodes
• Depends on whether “close by” nodes also in set
Problem Statement:• Choose set S so that:
• Sum of costs of nodes in S is at most C
• Maximize Information = f(S)
![Page 33: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/33.jpg)
Algorithmic Issue
Number of subsets of n locations = 2n
• Inefficient to enumerate over them
Given subset S, how do we compute f(S)• Needs a correlation model among locations
Communication costs are not additive• Also depend on location of nodes!
![Page 34: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/34.jpg)
Information Functions
f(S) = Entropy of S
Correlations are multidimensional Gaussian: = Covariance matrix between locationsEntropy log det()
Covariance(j,k) exp(-dist(j,k)2 / h2)
![Page 35: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/35.jpg)
Properties of f(S)
A B
v
Location v is more informative w.r.t A than w.r.t B
Property 2: f(A+v) - f(A) ≥ f(B+v) - f(B)
Property 1: f(A+v) ≥ f(A)
![Page 36: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/36.jpg)
Greedy Algorithm
Start with S =
Repeat till cost of S exceeds C:
• Choose v such that:• ( f(S+v) - f(S) ) / cv is maximized
• “Information gain per unit cost”
• Add v to S
![Page 37: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/37.jpg)
Analysis
Suppose:
All costs cv = 1
O = Best Information set of size at most C
At any stage, if adding v is best greedy decision
Adding entire O cannot give more information per unit cost!
f(S + v) - f(S) ≥ ( f(S + O) - f(S) )/C ≥ ( f(O) - f(S) )/C
Let d(S) = f(O) - f(S) = Deficit w.r.t. Optimal Solution
Implies: d(S) - d(S+v) ≥ d(S) / C
![Page 38: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/38.jpg)
Analysis
d(S+v) ≤ d(S) (1 - 1/C)
d(Initial) = f(O)
d(Final) = f(O) - f(Final)
f(O) - f(Final) = d(Final) ≤ d(Initial) ( 1 - 1/C )C ≤ f(O) / 2
Implies: f(Final) ≥ f(O) / 2
Greedy set has information at least 1/2 information in optimal set
![Page 39: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/39.jpg)
Two-Level Routing
Aggregation Hub
![Page 40: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/40.jpg)
Clustering
Optimal placement of cluster-heads
Minimize routing cost
![Page 41: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/41.jpg)
K-Means Algorithm Start with k arbitrary leaders
Repeat Steps 1 and 2 till convergence: Step 1:
• Assign each node to closest leader• Yields k “clusters” of nodes
Step 2:• For each cluster, choose “best” leader• Minimizes total routing cost within cluster
![Page 42: Routing and Network Design: Algorithmic Issues Kamesh Munagala Duke University](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e315503460f94b2212d/html5/thumbnails/42.jpg)
Analysis Convergence is guaranteed:
Each step reduces total distance• Step 1: Each node travels smaller distance• Step 2: Each cluster’s routing cost reduces
Rate of convergence:• Fast in practice
Quality of solution:• “Local” optimum depending on initial k nodes• Need not be best possible solution• Works very well in practice