1 / 25

Vertices and Edges

Vertices and Edges. Introduction to Graphs and Networks Mills College Spring 2012. Today’s Topics. Introduce concepts and jargon Basics of graph theory Different ways to represent networks/graphs. Graphs, vertices, edges .

calliem
Download Presentation

Vertices and Edges

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. Vertices and Edges Introduction to Graphs and Networks Mills College Spring 2012

  2. Today’s Topics • Introduce concepts and jargon • Basics of graph theory • Different ways to represent networks/graphs

  3. Graphs, vertices, edges. • The math of networks follows from the full matrix format we introduced above. That format is, in fact, what we call the adjacency matrix. • Adjacency matrix. • Incidence matrix • Notation and conventions. • Directed and undirected networks. • Distance or Path matrix

  4. Network = {vertices}, {edges} • A network is an entity containing two sets: • Set of vertices, • e.g., {A, B, C} • Set of edges where edges are pairs of vertices • e.g., {(A,B), (A,C)} B (A,B) A C (A,C)

  5. Tabular (Matrix) Representation B (A,B) A C (A,C)

  6. Exercise 1 • Sketch the network {a, b, c, d} {(a,b), (a,c), (a,d), (b,d), (c,d)} • Express this network in table/matrix form c a d b

  7. Exercise 2 • Express this network in table/matrix form e c a d b

  8. Self-edges and Multi-Edges • An edge that connects a vertex to itself is a self-edge. • If there is more than one edge between a pair of vertices we call it a multi-edge

  9. Exercise 3 • How do you think this would be represented in matrix form? c a d b

  10. Degree The degree of a vertex is the number of edges connected to it. 2 0 f e 2 3 c a 3 d b 4

  11. Degree Distribution

  12. Directed and Undirected Graphs • Edges can have direction – from vertex A to vertex B • Edges are then represented as ORDERED pair (a,b) but not (b,a) • A directed graph is also called a digraph X a b

  13. Exercise 4 • Sketch the digraph represented by this matrix a b d c

  14. In- and Out-degree in Digraphs • For vertices in a digraph we distinguish IN-degree (number of edges coming in) from OUT-degree (number going out) Degreein = 2 Degreeout = 2 Degreein = 1 Degreeout = 2 a b Degreein = 1 Degreeout = 3 Degreein = 3 Degreeout = 0 d c

  15. Exercise : Density • Describe the difference between these three 5 vertex networks

  16. Exercise • The network on the left is “maximally connected.” It has a total of 6 edges and each vertex has degree 3. • For network on right, calculate (a) ratio of # edges to possible # of edges, (b) for each vertex, ratio of its degree to maximum possible degree. a a b b d d c c

  17. Planar Networks • If a network can be drawn on a flat piece of paper without any edges crossing it is called a planar network.

  18. Exercise: Is this network planar? e c a c a d b d b e

  19. Paths • If there is an edge between two nodes, A and B, we say there is a path from A to B. If there is a sequence of paths from A to B to C, then we say there is a path from A to C • Path length is number of edges on the path.

  20. Geodesic & Diameter • Shortest path between 2vertices is a geodesic • Longest path in a graph is its diameter. a b Geodesic between a and d is a-c-d of length 2 Diameter of graph is 4 c e d

  21. Connected Graphs • In a connected graph there is a path from any given vertex to any other given vertex. • A directed graph is strongly connected when there is a directed path from any given vertex to any other. • It is weakly connected if it is only connected when you treat the edges as undirected.

  22. Fully Connected • A fully connected graph is one that has all the possible edges • It is also called a clique or k-clique (Kn). a a b d c K2 K3 K4 K5 a a a b b b d c c

  23. Exercise: Label the Cliques

  24. Counting Paths • How many paths from a to f? • How many paths from a to f? a f e ONE b c d a f e TWO b c d

  25. Exercise Counting Paths • How many paths from a to f? • What is the shortest path from a to f? • What is the longest path in this graph? FOUR a f e 2 paths A-C times 2 paths D-F = 4 paths A-F b c d

More Related