TABLE 1: Graph Terminology TypeEdgesMultiple Edges Allowed? Loops Allowed? Simple graphUndirectedNo...
-
Upload
jemimah-lewis -
Category
Documents
-
view
218 -
download
0
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)
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
“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
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.
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.