1 / 62

TCOM 540

TCOM 540. Session 2. Web Page. http://teal.gmu.edu/ececourses/tcom540/TCOM540541.htm. Set Theory. A set is a collection of (mathematical) objects E.g., {A, B, C} E.g., {1,2,3, …, 99} s e S means “s is a member of S” s ~ e S means “s is not a member of S”

tasya
Download Presentation

TCOM 540

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. TCOM 540 Session 2 TCOM 540/1

  2. Web Page • http://teal.gmu.edu/ececourses/tcom540/TCOM540541.htm TCOM 540/1

  3. Set Theory • A set is a collection of (mathematical) objects • E.g., {A, B, C} • E.g., {1,2,3, …, 99} • s e S means “s is a member of S” • s ~ e S means “s is not a member of S” • T is a subset of S if every member of T is also a member of S • It’s a proper subset if there is at least one member of S that is not a member of T TCOM 540/1

  4. Set Theory (2) • The set of all subsets of S is denoted as 2s • If S has n members, then 2s has 2n members • Union of two sets is the set of all their members • Intersection of two sets is the set of common members TCOM 540/1

  5. Set Theory (3) Intersection Union TCOM 540/1

  6. Set Theory (4) • Cartesian Product of two sets, S and T, is the set SxT • Elements are (s,t) where s e S and t eT • The graph of a function f:S T is the subset of SxT that consists of {(s,t) f(s) = t)} TCOM 540/1

  7. Graphs • A graph consists of a set of vertices (or nodes) V and a set of edges E D C Z B A I TCOM 540/1

  8. Some Definitions for Graphs • Each edge connects two vertices (may be same – then it’s called a loop) • Two edges are called parallel if they connect the same vertices • A graph is simple if it has no loops or parallel edges • The degree of a vertex is the number of edges it has • Two nodes are adjacent if there is an edge that has them as endpoints TCOM 540/1

  9. Some Definitions for Graphs (2) • A path between vertices v1 and vn is a set of edges (e1, e2, …, en) such that ei and ei+1 have a common endpoint, and v1 is an endpoint of e1 and vn is an endpoint of en • A cycle is a path from a vertex to itself • A graph is connected if for any two nodes there is a path between them TCOM 540/1

  10. A Small (But Not Simple) Graph D Parallel edges Adjacent nodes C Z B A I Loop Node degree 3 (DZ), (ZB), (BI), (ID) is a cycle. This graph is connected TCOM 540/1

  11. Definitions (3) • A subgraph G* of a graph G with vertices V and edges E is a pair (V*, E*) where • V* is a subset of V • E* is a subset of E • If an edge belongs to E* then both its endpoints must belong to V* • A component of a graph is a maximal connected subgraph • Two graphs G1, G2 are isomorphic if there is a 1-to-1 mapping f:V1 V2 such that (v1, v2) is a member of E1 iff (f(v1), f(v2)) is a member of E2 TCOM 540/1

  12. Another Graph X P e7 e15 e5 D J C K e2 Z e99 e9 e4 e8 e11 e6 e1 e16 B M Q e12 A e13 N I e3 H R ( (D, Z, B, M, J), (e2, e8, e4)) is a subgraph It is not a component. The two right-hand components are isomorphic TCOM 540/1

  13. Definitions (4) • A tree is a connected simple graph without cycles • A star is a tree in which exactly one node has degree >1 • A chain is a tree in which no node has degree greater than 2 • Define N(G) = number of nodes in G TCOM 540/1

  14. Tree, Star, Chain TCOM 540/1

  15. V&H Coordinates • V&H coordinate grid covers U.S. • Approx 10,000 x 10,000 • Distance between points (v1, h1) and (v2, h2) for tariff calculations is sometimes defined as: • A simpler formulation is: • Note V&H assumes earth is flat … Dist = 1+int{[(dv2+9)/10+(dh2 +9)/10]0.5} Where dv = v1-v2 and dh = h1-h2 Dist = 1 + int[(dv2+dh2)/10] TCOM 540/1

  16. Latitude and Longitude • V&H used primarily in North America • Most of world uses latitude and longitude (L&L) • Distances between points in L&L coordinates are computed using spherical geometry TCOM 540/1

  17. Node Locations TCOM 540/1

  18. A Real Network (Backbone Not Shown) Vendor A Cost: $1.159M Vendor B Cost: $1.213M 164 Hosts

  19. Real Network Detail (Atlanta, GA) Stand Alone Hosts TCOM 540/1

  20. Weighted Graph • A weighted graph is a graph G where each edge e has a weight w(e) • Denoted by (G, w) • Generally w(e) > 0 • Weight of a subgraph G* is sum of weights of edges in G* • Real networks are weighted graphs • Weight may be cost, delay, or other parameter • Minimum spanning tree (MST) is a connected subgraph with minimum weight TCOM 540/1

  21. Kruskal’s Algorithm for MST Sort edges in ascending order of weight Is G connected? stop no yes Mark each node as Separate component Loop on edges Let e be candidate edge If ends of e are in different components, accept e Stop when number of edges = N(G) - 1 TCOM 540/1

  22. Kruskal’s Algorithm for MST (2) 30 27 26 31 25 21 29 TCOM 540/1

  23. Kruskal’s Algorithm for MST (2) 30 27 26 31 25 21 29 1st add 21 TCOM 540/1

  24. Kruskal’s Algorithm for MST (2) 30 27 26 31 25 21 29 1st add 2nd add 25 21 21 TCOM 540/1

  25. Kruskal’s Algorithm for MST (2) 30 27 26 31 25 21 29 1st add 2nd add 3rd add 27 25 25 21 21 21 TCOM 540/1

  26. Kruskal’s Algorithm for MST (2) 30 27 26 31 25 21 29 1st add 2nd add 3rd add 4th add 27 27 25 25 25 21 21 21 21 29 TCOM 540/1

  27. Prim’s Algorithm for MST Start with all nodes unconnected and Label = infinity Scan neighbors, update Labels = min edge to tree Select root node Add closest neighbor (smallest Label) Stop when N(G) –1 added TCOM 540/1

  28. Prim’s Algorithm for MST (2) 30 Choose as root 27 26 31 25 21 29 TCOM 540/1

  29. Prim’s Algorithm for MST (2) 30 Choose as root 27 26 31 25 21 29 1st Add 27 TCOM 540/1

  30. Prim’s Algorithm for MST (2) 30 Choose as root 27 26 31 25 21 29 1st Add 2nd Add 27 27 21 TCOM 540/1

  31. Prim’s Algorithm for MST (2) 30 Choose as root 27 26 31 25 21 29 1st Add 2nd Add 3rd Add 27 27 27 25 21 21 TCOM 540/1

  32. Prim’s Algorithm for MST (2) 30 Choose as root 27 26 31 25 21 29 4th Add 1st Add 2nd Add 3rd Add 27 27 27 27 25 25 21 21 21 29 TCOM 540/1

  33. Limitations of MSTs • No redundancy • One link failure separates the network into two disconnected components • Big problem for large networks • May involve very long paths in large networks TCOM 540/1

  34. MSTs Do Not Scale • Number of hops between nodes n1 and n2 is the number of edges in the path chosen by the routing algorithm • Average number of hops is traffic-weighted = (Sn1,n2traffic(n1,n2)*hops(n1,n2))/Sn1,n2traffic(n1,n2) TCOM 540/1

  35. MSTs Do Not Scale (2) TCOM 540/1

  36. MSTs Do Not Scale (3) TCOM 540/1

  37. Definitions • For a weighted graph (G,w), and nodes n1 and n2, the shortest path P from n1 to n2 minimizes SeePw(e) • The shortest-path tree (SPT) rooted at node n1 is a tree T such that for any other node n2 the path from n1 to n2 is a shortest path TCOM 540/1

  38. Dijkstra’s Algorithm for Shortest-Path Trees • Mark each node unscanned, assign label infinity • Set label of root to 0, and predecessor to self • Loop through nodes • Find node n with smallest label • Mark as scanned • Examine all adjacent nodes m, see if distance through n < label • If so, update label, update predecessor(m) = n • Note that a link may drop out of the tree if a shorter route is found TCOM 540/1

  39. Dijkstra Example 30 Choose as root 1 27 1 5 31 25 2 21 3 4 29 TCOM 540/1

  40. Dijkstra Example 30 Choose as root 1 27 1 5 31 25 2 21 3 4 29 1 & 2. Nodes adjacent to root 30 1 27 5 Label = 30 2 Label = 27 TCOM 540/1

  41. Dijkstra Example 30 Choose as root 1 27 1 5 31 25 2 21 3 4 29 3. Nodes adjacent to 2 1 & 2. Nodes adjacent to root Label = 28 30 1 1 27 1 5 27 5 Label = 30 2 2 21 3 Label = 27 Label = 48 TCOM 540/1

  42. Dijkstra Example 30 Choose as root 1 27 26 5 31 25 2 21 3 4 29 3&4. Nodes adjacent to 2 4&5. Nodes adjacent to 5 1 & 2. Nodes adjacent to root Label = 28 30 1 1 1 1 27 27 1 5 27 5 5 Label = 30 31 2 2 25 2 21 3 3 Label = 27 Label = 53 Label = 48 4 Label = 59 TCOM 540/1

  43. Characteristics of SPTs • In a complete graph, SPT is a star* • High performance and reliability • But likely implies low link utilization, high expense * Unless triangle inequality does not hold TCOM 540/1

  44. Prim-Dijkstra Trees • We play with the definition of the Label • Prim’s Label = minneighborsdist(node, neighbor) • Dijkstra’s Label = minneighbors[dist(root, neighbor) + dist(neighbor, node)] • Prim-Dijkstra Label = = minneighbors[a*dist(root, neighbor) + dist(neighbor, node)] • Now a is a parameter that we choose, between 0 and 1 TCOM 540/1

  45. Varying Alpha TCOM 540/1

  46. Tours • A tree design may be unreliable • A tour adds one link to significantly increase reliability • A tour of a set of vertices (v1, v2, …, vn) is a set of n edges such that each vertex has degree 2 and the graph is connected TCOM 540/1

  47. Tours (2) • Leads to the (in)famous Traveling Salesman Problem (TSP) • Given a set of vertices (v1, v2, …, vn) and a distance function d(vi,vj) between vertices, find the tour T(vti) such that Sd(vti,ti+1) is minimized TCOM 540/1

  48. Reliability of a Tree • Reliability = probability that functioning nodes are connected by working links • For a tree, reliability = (1-p)n-1, where • p = probability of a link failing • n = number of nodes • P(failure) = 1- reliability = 1 - (1-p)n-1 @ (n-1)*p TCOM 540/1

  49. Reliability of a Ring • A ring can tolerate one failure • For a ring, P(failure) = 1- (1-p)n – n*p*(1-p)n-1 @ 0.5*n*(n-1)*p2 if p is small X TCOM 540/1

  50. A Simple Algorithm for Building a Tour • Denote a root node, set current node = root • Loop through nodes • Find closest node (not in tour) to current node • Add an edge to it • Reset current node to be this node just added • Create an edge between last node and root TCOM 540/1

More Related