TABLE 1: Graph Terminology TypeEdgesMultiple Edges Allowed? Loops Allowed? Simple graphUndirectedNo...

19
TABLE 1: Graph Terminology Type Edges Multiple Edges Allowed? Loops Allowed? Simple graph Undirected No No Multigraph Undirected Yes No Pseudograph Undirected Yes Yes Simple directed graph Directed No No Directed multigraph Directed Yes Yes Mixed Graph Directed and Undirected Yes Yes 9.1 Introduction to Graphs

Transcript of TABLE 1: Graph Terminology TypeEdgesMultiple Edges Allowed? Loops Allowed? Simple graphUndirectedNo...

TABLE 1: Graph Terminology

Type Edges Multiple Edges Allowed?

Loops Allowed?

Simple graph Undirected No No

Multigraph Undirected Yes No

Pseudograph Undirected Yes Yes

Simple directed graph Directed No No

Directed multigraph Directed Yes Yes

Mixed Graph Directed and Undirected Yes Yes

9.1 Introduction to Graphs

Graph Models

• Graphs are used extensively for modeling real-world phenomena

• Example: – Vertices are states of the US. Edge between

v and w if v shares a border with w.

More Examples• “Friend” graph for Facebook connections• Computer networks• Cities and highway routes• Cities and airline flights• Round robin tournaments, “defeated”• Statements in a program, “must be

executed before”• Telephone calls made in a network (“Call”

graph)

Precedence Graphs Elaborated

S1 a:=0

S2 b:=1

S3 c:=a+1

S4 d:=b+a

S5 e:=d+1

S6 e:=c+d

9.2 Graph Terminology• Terms

– Adjacent:

– Incident:

− Degree:

– Isolated:

– Pendant:

Example:

1. A is adjacent to

2. The degree of vertex b is

3. The pendant vertices of the graph are

The Handshaking Theorem

Let G be a pseudograph with vertex set V and edge set E. Suppose there are e edges, i.e. |E| = e. Then

In other words, “the sum of the degrees of the vertices is twice the number of edges.”

Vv

ev 2deg

Corollary: An undirected graph has an even number of vertices of odd degree.

Directed Graph Terminology

• Initial vertex, terminal vertex

• Indegree

• Outdegree

Example:

“Handshaking Theorem” for Directed Graphs

Let G be a directed multigraph with vertex set V and edge set E. Suppose there are e edges, i.e. |E| = e. Then

In other words, “the sum of the indegrees of the vertices is equal to the sum of the outdegrees of the vertices, and both are equal to the number of edges.”

VvVv

evv degdeg

The “Underlying Undirected Graph”

Complete Graphs

A simple undirected graph is a complete graph if all possible edges are present.

Other Specialized Graphs

• The Cycle Cn

• The Wheel Wn

• The n-Cube Qn

Bipartite Graphs

• A graph G = (V,E) is said to be bipartite if and only if there is a two set partition {V1, V2} of V such that every edge e in E has one of its endpoints in V1 and the other in V2.

The Complete Bipartite Graph Kmn

𝐾 2,3 𝐾 2,1

Bipartite Graphs

• Theorem: A simple graph is bipartite if and only if it is possible to assign one of two different colors to each vertex of the graph so that no two adjacent vertices are assigned the same color

Subgraphs, Unions, Intersections, and Complements

• A graph G = (V′, E′) is a subgraph of graph H= (V,E) if and only if V′ V and E′ E.

• The union of two graphs is formed using the union of the two vertex sets and the union of the two edge sets.

• The intersection Is defined similarly.• The complement of a graph is the graph

which is formed using the same vertex set as the original graph , but which has an edge between two vertices if and only if the original graph does not have such an edge.

Examples: