Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vertices and Edges Introduction to Graphs and Networks Mills College Spring 2012.

Similar presentations


Presentation on theme: "Vertices and Edges Introduction to Graphs and Networks Mills College Spring 2012."— 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)} A B C (A,B) (A,C)

5 Tabular (Matrix) Representation ABC A-11 B-0 C- A B C (A,B) (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 a b c d abcd a-111 b-01 c-1 d

7 Exercise 2 Express this network in table/matrix form a b c d abcde a-1110 b-011 c-11 d-1 e- e

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? a b c d abcd a1000 b100 c10 d1

10 Degree The degree of a vertex is the number of edges connected to it. a b c d e f 2222 00 44 3333

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 ba X abcd a-1 b0- c- d-

13 Exercise 4 Sketch the digraph represented by this matrix abcd a-101 b0-11 c11-1 d000- b c a d

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) b c a d Degree in = 2 Degree out = 2 Degree in = 1 Degree out = 3 Degree in = 1 Degree out = 2 Degree in = 3 Degree out = 0

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. b c a d b c a d

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? a b c d e a b c d 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. b d a e c Geodesic between a and d is a-c-d of length 2 Diameter of graph is 4

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 (K n ). bab c ab c a d b c a d a K2K2 K3K3 K4K4 K5K5

23 Exercise: Label the Cliques

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

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? f c a b e d 2 paths A-C times 2 paths D-F = 4 paths A-F FOUR


Download ppt "Vertices and Edges Introduction to Graphs and Networks Mills College Spring 2012."

Similar presentations


Ads by Google