1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in...

24
1 Section 8.2 Graph Terminology
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    7

Transcript of 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in...

Page 1: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

1

Section 8.2

Graph Terminology

Page 2: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

2

Terms related to undirected graphs

• Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in G if there is an edge {u,v}

• Incident, connect: if edge e = {u,v}, e is incident with vertices u & v, and e connects u and v

• Endpoints: vertices u & v are endpoints of edge e

Page 3: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

3

Terms related to undirected graphs

• Degree of vertex in an undirected graph is the number of edges incident with it– loops count twice– degree of vertex v is denoted deg(v)

• Example: what are the degrees of the vertices in this graph?

Page 4: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

4

Terms related to undirected graphs

• Isolated vertex (like e in previous example) has degree 0, not adjacent to any other vertex

• Pendant vertex (like d in previous example) - adjacent to exactly one vertex

• The sum of the degrees of all vertices in a graph is exactly twice the number of edges in the graph

Page 5: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

5

Handshaking Theorem

• Let G=(V,E) be an undirected graph with e edges; then 2e =

Vv

v)deg(

• Note that sum of degrees of vertices is always even; this leads to the theorem:

An undirected graph has an even number of vertices of odd degree

Page 6: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

6

Terminology related to directed graphs

• Let G be a directed graph, with an edge e=(u,v):– u is initial vertex– v is terminal, or end vertex– u is adjacent TO v– v is adjacent FROM u– initial & terminal vertex of a loop are the same

Page 7: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

7

Terminology related to digraphs

• In-degree of vertex v, denoted deg-(v), is the number of edges with v as the terminal vertex

• Out-degree of vertex v, denoted deg+(v), is the number of edges with v as the initial vertex

• A loop has one of each

Page 8: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

8

Terminology related to digraphs

• The sum of in-degrees is equal to the sum of out-degrees

• Both are equal to the number of edges in the graph:– Let G=(V,E) be a directed graph; then

VvVv

vv |E|)(deg)(deg

• The undirected graph that results from ignoring arrows in a directed graph is called the underlying undirected graph

Page 9: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

9

Classes of simple graphs

• Complete graphs: complete graph on n vertices, denoted Kn, is the simple graph that contains exactly one edge between each pair of distinct vertices; Examples:

Page 10: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

10

Classes of Simple Graphs

• Cycle: Cn, where n 3, consists of n vertices v1, v2, … , vn and edges {v1, v2}, {v2, v3}, … , {vn-1, vn} Examples:

Page 11: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

11

Classes of Simple Graphs

• Wheel: a cycle with an additional vertex, which is adjacent to all other vertices; example:

Page 12: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

12

Classes of Simple Graphs

• n-Cube: denoted Qn, is a graph representing the 2n bit strings of length n:

• 2 vertices are adjacent if and only if the bit strings they represent differ in exactly one position. Examples:

Page 13: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

13

Bipartite Graphs

• A simple graph G is called bipartite if its vertex set V can be partitioned into 2 disjoint non-empty sets V1 and V2 such that:

– every edge connects a vertex in V1 with a vertex in V2

– no edge connects 2 vertices in V1 or in V2

Page 14: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

14

Example: lining up 1st graders

Cate JohnMary MarkMary Ann TerryMary Pat TimMarie Jimmy

Page 15: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

15

Example - cycle

• C6 is bipartite; can partition its vertex set into 2 distinct sets:– V1 = {v1, v3, v5)

– V2 = {v2, v4, v6}

– with every edge connecting a vertex in V1 with one in V2

Page 16: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

16

ExamplesGraph at left is not bipartite; to divide into2 sets, one set must include 2 vertices and tobe bipartite, those vertices must not be connectedBut every vertex in this graph is connected to2 others

This graph, on the other hand, is bipartite; thetwo sets are V1 = {v1, v3, v5} and V2 = {v2, v4, v6}Note that the definition doesn’t say a vertex inone set can’t connect to more than one vertex inthe other - only that each in one must connect to one in the other, and no vertex in a set can connectto a vertex in the same set

Page 17: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

17

Examples: are they bipartite?

Page 18: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

18

Complete Bipartite Graphs

• Denoted Km,n is the graph that has its vertex set partitioned into 2 subsets of m vertices and n vertices

• There is an edge between 2 vertices if and only if one vertex is in the first subset and the other is in the second subset

Page 19: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

19

Examples

Page 20: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

20

Applications of Special Types of Graphs: LAN topology

• A star is a complete bipartite K1,n graph:

• A ring is an n-cycle:

• A redundant network may have both a central hub and a ring, forming a wheel:

Page 21: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

21

Subgraph

• Graph obtained by removing vertices and their associated edges from a larger graph; more formally:

• Subgraph of G=(V,E) is H=(W,F) where WV and FE

Page 22: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

22

Subgraph Example

Page 23: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

23

Can combine graphs, forming a union

• Let G1 = (V1, E1) and G2 = (V2, E2)

• The union, G1 G2 = (V1 V2, E1 E2)

Page 24: 1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.

24

Section 8.2

Graph Terminology