 Download Download Presentation ECE 643- Design and Analysis of Computer Networks K Shortest Paths

# ECE 643- Design and Analysis of Computer Networks K Shortest Paths

Télécharger la présentation ## ECE 643- Design and Analysis of Computer Networks K Shortest Paths

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. ECE 643- Design and Analysis of Computer NetworksK Shortest Paths Dept. of Electrical and Computer Eng. George Mason UniversityFairfax, VA 22030-4444, USA Fall 2012

2. Why KSP? • Sometimes, it is necessary to consider additional constraints that are additive to the original routing problems, such as maximum delay requirement. • Optimization of all the additive constraints also is NP-hard. • Additive constraints only need to be satisfied rather than optimized.

3. How to KSP • The calculation of KSP is based on the shortest path algorithm, which can be achieved through Dijkstra’s algorithm. • Two different algorithms for KSP will be introduced here: • Recursive Enumeration Algorithm (REA) • YEN’s Algorithm

4. Recursive Enumeration Algorithm (REA) (1) • Define a digraph G=<V, E>, where V is the node set and E is the edge set. • Define N(t) as the neighbor nodes set of node v. • Define πk(v) is the kth shortest path from s to v. • It is easy to find the shortest path from node s to v and other node, and denote them as π1(u), u∈V. 2 0 0 2 1 4 3 0 5 1 2 0 3 V={1 ,2, 3, 4, 5} E={12, 14, 13, 25, 24, 34, 45} N(4)={1, 2, 3} (5 is not 4’s neighbor)

5. Recursive Enumeration Algorithm (REA) (2) • NextPath(v, k) • If k=2, then initialize a set of candidates to the next shortest path from s to v by setting C[v]←{π1(u)v: u∈N(v) and π1(v)≠π1(u)v} • If v=s and k=2, then go to 6 • Let u and k’ be the node and index, respectively, such that πk-1(v)=πk’(u)v • If πk’+1(u) has not been computed yet, compute it by calling NextPath(u,k’+1). • If πk’+1(u) exists, then insert πk’+1(u)v in C[v] • If C[v]≠empty, then select and delete the path with minimum length from C[v] and assign it to π1(v), otherwise πk(v) does not exist.

6. YEN’s Algorithm Initial solution tree with the shortest path, i<-1 and initial a heap, cache the source node. Traverse the tree for nodes has not been cached. If all nodes has been cached, go to step 8. Block the corresponding nodes and edges. Find the shortest path from the point to the destination. If no path can be found, goto step 6. Push the found path into the heap, unblock the corresponding nodes and edges. Cache the node. Gotostep 2 If the heap is empty, exit. Otherwise, output the shortest path in the heap, add the path into the solution tree, i<-i+1, un-cache the corresponding deviation node. If i=k, exit. Otherwise, goto step 2 2 0 0 2 1 4 3 0 5 1 2 0 3

7. A Sample Solution Tree

8. Sample Digraph 5 12,1,2,0 13,1,3,1 14,1,4,3 24,2,4,2 25,2,5,0 34,3,4,0 35,3,5,2 45,4,5,0 2 0 0 2 1 4 3 0 5 1 2 0 3

9. Project Schedule (2012) • Part I - Generate and output the network graph (20%) (November 12th) • We need to have a program which can generate a network graph from a input file. You also need to demonstrate the graph by printing the list of the nodes and edges. • Part II - Shortest Path (20%) (November 19th) • Implement Dijkstra’s algorithm yourself • Part III – K shortest Path (60%) (November 26th) • Find the K shortest paths in a network, where • K can be any integer greater than 0. If all possible paths are exhausted before K is reached, the program should output “path exhausted” (20%) • The path should be output in the order of length (20%) • All paths should be loopless (20%) • Presentation on December 3rd