1 / 30

Graph Theory in Networks

Graph Theory in Networks. Lecture 2, 9/2/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley. Plan for Graph Segment. Lecture 2 – Thu (Sep 2, 2004) Paths and Routing Cycles and Protection Matching and Switching Lecture 3 – Tue (Sep 7, 2004) Coloring and Capacity

aya
Download Presentation

Graph Theory in Networks

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. Graph Theory in Networks Lecture 2, 9/2/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley

  2. Plan for Graph Segment • Lecture 2 – Thu (Sep 2, 2004) • Paths and Routing • Cycles and Protection • Matching and Switching • Lecture 3 – Tue (Sep 7, 2004) • Coloring and Capacity • Trees and Broadcast, Multicast • Lecture 4 – Thu (Sep 9, 2004) • Complete example: Capacity in Ad-Hoc Networks • Lectures 5 & 6 – (Sep 14 & 16, 2004) • Student Presentations (have you signed up ?)

  3. Network looks like Graph !

  4. Using Graph Theory in Networking • Modeling • Appropriate underlying graph • Captures required behavior • Warning: slight difference entirely changes results • Analysis • Proofs/results from relevant graph theoretic technique • Reality Check • Does in make sense ? • Perhaps ignored some important feature

  5. Routing: Dijkstra • Dijkstra, E.W., “A Note on Two Problems in Connexion with Graphs,” Numerische Mathematik, vol.1, pp. 269-271, 1959. • Given a graph G = (V, E) • Finds weighted shortest path from a single source to all other nodes • Works with non-negative edge weights • Applications • OSPF routing (edge weight = 1) • Mapquest (edge weight = traversal time) • Many, many, many more …

  6. Dijkstra Review • Initialize • while • end while

  7. Proof of Correctness • Need to show that this is correct ! • Thm: Label v(i) is the shortest path cost to i • Lemma: Labels in P are the shortest path involving nodes in P. Then when P = V, the theorem holds • Proof of Lemma • Suppose we have a shorter path using node in T • Let be two nodes in path, with in between • But if • Then we would have picked t before q (Contradicton)

  8. Principle of Optimality • Partial paths of SP are also shortest • Proof: • Let P={s,…,p,…i,…q,…d} be the SP from s to d • Suppose {p,…i,…q} as above is not SP from p to q i.e. Cost {p,…i,…q} > Cost {p,…j,…q} • Then, P’={s,…,p,…j,…q,…d} has lesser cost than P • So P is not the SP (contradiction) • Allows computing partial path and extending hop by hop

  9. General Principle of Optimality • In general, hope that partial paths of “optimal” paths are also optimal. E.g. • Minimum Delay Paths • Widest path • If true, amenable to distributed algorithms • If not, often NP-hard  • E.g. Shortest Widest Path • Both types of cases found in networking • Will cover in Lecture 4

  10. Optimality Counter-example

  11. Dijkstra Complexity • Initialize • while • end while

  12. Dijkstra Complexity (contd) • True metric of algorithm usefulness • n = # of nodes, m = # of edges • Dijkstra • Main loop runs n times • Finding min takes O(n) • Then, updating values is O(m) • So, total algo is O(n2+m) • Can improve loop+min (using binary heap) to give O(nlogn+m)

  13. Other Routing Algorithms • Bellman Ford • single source shortest path, negative wts • O(mn) • Floyd Warshall • all pairs shortest path • O(n3) • Johnson • all pairs shortest path • O(n(m+nlogn)) obvious for +ve edge weights • All-pairs shortest path reqd to set up routing tables

  14. Directed Acyclic Graph (DAG) • Generalization of the tree concept to directed graphs • Special Features • Cannot have cycles • Always exists one node with in-degree 0 (Quick Proof) • Allows topological ordering of nodes • Applications • Tournaments, Games • Scheduling problems

  15. Due to lack of cycles, topological ordering of nodes (check up) Can be done in O(m) Correctness Since no cycles, we have checked every possible path over the for loop Algorithm Initialize for j = (s+1) to n next j Complexity We only check each edge once, so O(m) SP in DAG

  16. Protection Paths • In many situations, we need two paths • Normal Path • Protection Path • Types of protection • Path Protection • Span Protection • Link Protection • Type of protection paths • Node disjoint • Link Disjoint

  17. Common Algorithm Find Shortest Path  Make G’ = (V, E\) Find shortest path ’ in G’ Advantages Computationally simple Two Dijkstra/BF Shortest Normal Path, which is used much Backup path used rarely Problems Cost (+’) may not be optimal  may block off all possible ’ Min Cost Protection Paths

  18. P-Cycle

  19. P-Cycle (contd) • P-Cycle Algorithm • Want to find set of elementary cycles • Minimizes total capacity on these cycles • All working links must be protected • Integer programming solution • Followup: Given two nodes i,j, find min cost cycle in G that covers i and j

  20. What are you Protecting ? IP Layer • When modeling with a graph, remember • Present structure • Underlying behavior • In this case, unclear • Edge costs are IP layer costs • Protection guarantee is lower layer phenomenon • Perhaps need a different graph model Optical Layer • Normal Path • Protection Path

  21. Matching • M  E s.t no two edges in M share a common end node • A maximum cardinality matching is matching with a maximum number of edges • Max/min weighted matching chooses edges with max weight • Of special interest are matchings in Bi-Partite Graphs

  22. Switching ! N ports (input & output) Effectively, N input and N output ports Packets (w priority) are queued on input port Each port ‘ranks’ its preferrence for output ports based on priority Want optimal input-output match Matching in Bi-Partite Graph Stable Marriage • Look at M men and N women, with partner preferences • For any pair Alice & Bob, one of following is true • Alice & Bob are married • Alice prefers her partner to Bob • Bob prefers his partner to Alice • No pair (A,B) and (C,D) such that (A,D) and (B,C) would both be preferred :-)

  23. Stable Marriage Problem • Stable Marriage always exists, for any preferences • Girl-oriented Algorithm • Girls successively make proposals to boys (engaged or not) • If a girl proposes to a boy who is free (not yet paired), the boy ‘accepts’ the proposal. • If the girl proposes to a boy who is already paired • If this proposal is a better proposal from the boy’s perspective, then the boy breaks the old proposal and accepts the new one. • If the proposal is not a better one, the boy rejects the proposal. • Key of Proof • Consider arbitrary g. If g prefers b’ to b, then b’ must have rejected g and been paired with some g’ whom he prefers to g. As choice of g is arbitrary, there are no unstable pairs. • Algorithm completes within N2 iterations and is ‘girl-optimal’.

  24. Vertex Cover • Definition • Set of nodes NC of G such that every edge of G has at least one node in NC • Observe: • ‘Opposite’ of Matching • Max cardinality of matching is at most the min cardinality of node cover • Equal in a bi-partite graph • Application • Choose a min set of nodes in an ad-hoc network to exercise control over all the links

  25. Problem: Cover all nodes with disjoint cycles Want least total cost of these cycles Formulate G’ Replicate V into U, W Join ui to wj if (vi,vj)E cost(ui,wj) = cost(vi,vj) Observe G’ is bipartite Cycle Cover in G is perfect matching in G’ Therefore Evaluate min cost perfect matching in G’ Polynomial time (bi-partite) Min Cost Cycle Cover

  26. For any convex polyhedron, V-E+F=2 V = Vertices E = Edges F = Faces Examples Tetrahedron: V=4, E=6, F=4 Cube: V=8, E=12, F=6 Octahedron: V=6, E=12, F=8 Dodecahedron: V=20, E=30, F=12 Icosahedron: V=12, E=30, F=20 BuckyBall: V=60, E=90, F=32 Euler’s Formula

  27. Proof of Euler’s Formula • Proof by induction • If no edges, its an isolated vertex. So V=1, E=0, F=1 • Else choose any edge • If it connects two vertices, contract it. This reduces V by 1 and E by 1 • Else the edge must separate two faces (Jordan curve). Remove it. Reduces F by 1 and E by 1.

  28. Lessons from Today’s Lecture • Path algorithms useful for routing • Prove correctness • Principle of Optimality allows distributedness • Matching useful in Switching etc • Key Analyses • Correctness • Optimality • Complexity

  29. Papers to read • H. Luo, S, Lu, and V. Bhargavan, “A New Model for Packet Scheduling in Multihop Wireless Networks,” Proceedings ACM Mobicom, 2000, pp. 76-86. • M. Kodialam, and T. Nandagopal, “Characterizing the Achievable Rates in Multihop Wireless Networks,” Proceedings ACM Mobicom 2003, San Diego, CA, September 2003. • M. Kodialam and T. Lakshman, “Minimum Interference Routing with Applications to MPLS Traffic Engineering,” Proceedings IEEE INFOCOM 2000. • S. Deering and D. Cheriton, "Multicast Routing in Internetworks and Extended LANs", SIGCOMM'88, Stanford, CA, Aug 1988, 55-64. (Routing Portions) • McKeown Switching Paper (ask Jean)

  30. References • Graph Theory, by Frank Harary • Integer and Combinatorial Optimization, by G.L. Nemhauser and L.A. Wolsey • Network Flows: Theory, Algorithms and Applications by Ravindra K. Ahuja, Thomas L. Magnanti and James B. Orlin

More Related