+ All Categories
Home > Documents > Graph Theory in Networks

Graph Theory in Networks

Date post: 23-Jan-2016
Category:
Upload: aya
View: 37 times
Download: 0 times
Share this document with a friend
Description:
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 - PowerPoint PPT Presentation
Popular Tags:
30
Graph Theory in Networks Lecture 2, 9/2/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley
Transcript
Page 1: Graph Theory in Networks

Graph Theory in Networks

Lecture 2, 9/2/04EE 228A, Fall 2004

Rajarshi Gupta

University of California, Berkeley

Page 2: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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 ?)

Page 3: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

3

Network looks like Graph !

Page 4: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 5: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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 …

Page 6: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

6

Dijkstra Review

Initialize

while

end while

Page 7: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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)

Page 8: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 9: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 10: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

10 Optimality Counter-example

Page 11: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

11

Dijkstra Complexity

Initialize

while

end while

Page 12: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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)

Page 13: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 14: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 15: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

15

SP in DAG 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)

Page 16: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 17: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

17

4

10

106

2 4

1

6

1

4

10

106

2 4

1

6

1

Min Cost Protection Paths 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

4

10

106

2 4

1

6

1

Normal Cost =4+2+4=10

4

10

106

2 4

1

6

1

Normal Cost =4+2+4=10

Backup Cost =6+10=16

4

10

106

2 4

1

6

1

Normal &Backup Cost =

11+11=22

Page 18: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

18

P-Cycle

Page 19: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 20: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

20

What are you Protecting ?

IP Layer

Optical Layer

Normal Path

Protection Path

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

Page 21: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

21

2

8

3

43

6

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

Max CardinalityMatching

2

8

3

43

6

Max WeightedMatching

Page 22: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

22 Matching in Bi-Partite Graph

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

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 :-)

Page 23: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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’.

Page 24: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 25: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

25

Min Cost Cycle Cover 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)

Page 26: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

26

Euler’s Formula 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

Page 27: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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.

Page 28: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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

Page 29: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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)

Page 30: Graph Theory in Networks

Lecture 2, 9/2/04

EE 228A, Fall 2004

Rajarshi Gupta

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


Recommended