discrete mathematics and its...
Post on 18-Jul-2020
16 Views
Preview:
TRANSCRIPT
Discrete Mathematics and Its ApplicationsLecture 7: Graphs: Graph Models and Graph Types
MING GAO
DaSE@ECNU(for course related communications)
mgao@dase.ecnu.edu.cn
Jun. 15, 2020
Outline
1 Graphs
2 Graph Models
3 Graph Terminology and Special Types of GraphsBasic terminologySome Special Simple GraphsNew Graphs from Old
4 Take-aways
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 2 / 33
Graphs
Graphs - why should we care?
Motivation
Graphs in real world
“YahooWeb graph”: 1B vertices(Web sites), 6B edges (links)
Facebook, Twitter, etc: more than 1B users
Food Web: all biologies, food chain
Power-grid: vertices (plants or consumers), edges (power lines)
Airline route: vertices (airports), edges (flights)
Adoption: users purchase products, adopt services, etc.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 3 / 33
Graphs
Motivation questions
Questions
What do real graphs look like?
What properties of vertices, edges are important to model?What local and global properties are important to measure?
Are graphs helpful to understand the real world?
Social influenceRecommendationInformation propagationHuman behaviors
Is a sub-graph “normal” (Water army, fraud detection, spamfiltering, etc)?
How to generate realistic graphs?
How to get a “good” sample of a network?
How to design an efficient algorithm to handle large-scalegraphs?
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 4 / 33
Graphs
Graphs
Definition
A graph G = (V ,E ) consists of V , a nonempty set of vertices(or nodes) and E , a set of edges. Each edge has either one or twovertices associated with it, called its endpoints. An edge is said toconnect its endpoints.
The set V of a graph G may be infinite (infinite graph).
In this book we will usually consider only finite graphs.
A graph in which each edge connects two different vertices andwhere no two edges connect the same pair of vertices is calleda simple graph.
Graphs that may have multiple edges connecting the samevertices are called multigraphs.
To model this network we need to include edges that connect avertex to itself, such edges are called loops.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 5 / 33
Graphs
Graphs
Definition
A graph G = (V ,E ) consists of V , a nonempty set of vertices(or nodes) and E , a set of edges. Each edge has either one or twovertices associated with it, called its endpoints. An edge is said toconnect its endpoints.
The set V of a graph G may be infinite (infinite graph).
In this book we will usually consider only finite graphs.
A graph in which each edge connects two different vertices andwhere no two edges connect the same pair of vertices is calleda simple graph.
Graphs that may have multiple edges connecting the samevertices are called multigraphs.
To model this network we need to include edges that connect avertex to itself, such edges are called loops.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 5 / 33
Graphs
Directed graphs and graph terminology
Definition
A directed graph (or digraph) (V ,E ) consists of a nonempty setof vertices V and a set of directed edges (or arcs) E . Each directededge is associated with an ordered pair of vertices. The directed edgeassociated with the ordered pair (u, v) is said to start at u and endat v .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 6 / 33
Graphs
Directed graphs and graph terminology
Definition
A directed graph (or digraph) (V ,E ) consists of a nonempty setof vertices V and a set of directed edges (or arcs) E . Each directededge is associated with an ordered pair of vertices. The directed edgeassociated with the ordered pair (u, v) is said to start at u and endat v .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 6 / 33
Graph Models
Graph models I
Social networks
Graphs are extensively used to model social structures based on d-ifferent kinds of relationships between people or groups of people.These social structures are known as social networks.
We can use a simple graph to representwhether two people know each other.
In studies of group behavior, certain people caninfluence the thinking of others.
The graph is to model that two people arerelated by working together in a particular way.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 7 / 33
Graph Models
Graph models I
Social networks
Graphs are extensively used to model social structures based on d-ifferent kinds of relationships between people or groups of people.These social structures are known as social networks.
We can use a simple graph to representwhether two people know each other.
In studies of group behavior, certain people caninfluence the thinking of others.
The graph is to model that two people arerelated by working together in a particular way.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 7 / 33
Graph Models
Graph models I
Social networks
Graphs are extensively used to model social structures based on d-ifferent kinds of relationships between people or groups of people.These social structures are known as social networks.
We can use a simple graph to representwhether two people know each other.
In studies of group behavior, certain people caninfluence the thinking of others.
The graph is to model that two people arerelated by working together in a particular way.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 7 / 33
Graph Models
Graph models I
Social networks
Graphs are extensively used to model social structures based on d-ifferent kinds of relationships between people or groups of people.These social structures are known as social networks.
We can use a simple graph to representwhether two people know each other.
In studies of group behavior, certain people caninfluence the thinking of others.
The graph is to model that two people arerelated by working together in a particular way.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 7 / 33
Graph Models
Graph models II
Communication networks
We can model different communications networks using verticesto represent devices and edges to represent the particular type ofcommunications links of interest.
Graphs can be used to model telephone callsmade in a network, such as a long distancetelephone network.
In Sina Weibo, via observing the retweetbehavior, Guo Meimei scandal cascades in thenetwork.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 8 / 33
Graph Models
Graph models II
Communication networks
We can model different communications networks using verticesto represent devices and edges to represent the particular type ofcommunications links of interest.
Graphs can be used to model telephone callsmade in a network, such as a long distancetelephone network.
In Sina Weibo, via observing the retweetbehavior, Guo Meimei scandal cascades in thenetwork.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 8 / 33
Graph Models
Graph models II
Communication networks
We can model different communications networks using verticesto represent devices and edges to represent the particular type ofcommunications links of interest.
Graphs can be used to model telephone callsmade in a network, such as a long distancetelephone network.
In Sina Weibo, via observing the retweetbehavior, Guo Meimei scandal cascades in thenetwork.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 8 / 33
Graph Models
Graph models III
Information networks
Graphs can be used to model various networks that link particulartypes of information.
Graphs can be used to represent citations indifferent types of documents, includingacademic papers, patents, and legal opinions.
The World Wide Web can be modeled as adirected graph where each Web page isrepresented by a vertex and where an edgestarts at the Web page a and ends at the Webpage b if there is a link on a pointing to b.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 9 / 33
Graph Models
Graph models III
Information networks
Graphs can be used to model various networks that link particulartypes of information.
Graphs can be used to represent citations indifferent types of documents, includingacademic papers, patents, and legal opinions.
The World Wide Web can be modeled as adirected graph where each Web page isrepresented by a vertex and where an edgestarts at the Web page a and ends at the Webpage b if there is a link on a pointing to b.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 9 / 33
Graph Models
Graph models III
Information networks
Graphs can be used to model various networks that link particulartypes of information.
Graphs can be used to represent citations indifferent types of documents, includingacademic papers, patents, and legal opinions.
The World Wide Web can be modeled as adirected graph where each Web page isrepresented by a vertex and where an edgestarts at the Web page a and ends at the Webpage b if there is a link on a pointing to b.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 9 / 33
Graph Models
Graph models IV
Software design applications
Graph models are useful tools in the design of software. We willbriefly describe two of these models here.
A module dependency graph provides a usefultool for understanding how different modules ofa program interact.
Computer programs can be executed morerapidly by executing certain statementsconcurrently. The dependence of statementscan be represented by a directed graph.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 10 / 33
Graph Models
Graph models IV
Software design applications
Graph models are useful tools in the design of software. We willbriefly describe two of these models here.
A module dependency graph provides a usefultool for understanding how different modules ofa program interact.
Computer programs can be executed morerapidly by executing certain statementsconcurrently. The dependence of statementscan be represented by a directed graph.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 10 / 33
Graph Models
Graph models IV
Software design applications
Graph models are useful tools in the design of software. We willbriefly describe two of these models here.
A module dependency graph provides a usefultool for understanding how different modules ofa program interact.
Computer programs can be executed morerapidly by executing certain statementsconcurrently. The dependence of statementscan be represented by a directed graph.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 10 / 33
Graph Models
Graph models V
Transportation networks
We can use graphs to model many different types of transportationnetworks, including road, air, and rail networks, as well shipping net-works.
The resulting graph will generally be a directedmultigraph, as there may be multiple flightsfrom one airport to some other airport duringthe same day.
In such models, vertices represent intersectionsand edges represent roads.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 11 / 33
Graph Models
Graph models V
Transportation networks
We can use graphs to model many different types of transportationnetworks, including road, air, and rail networks, as well shipping net-works.
The resulting graph will generally be a directedmultigraph, as there may be multiple flightsfrom one airport to some other airport duringthe same day.
In such models, vertices represent intersectionsand edges represent roads.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 11 / 33
Graph Models
Graph models V
Transportation networks
We can use graphs to model many different types of transportationnetworks, including road, air, and rail networks, as well shipping net-works.
The resulting graph will generally be a directedmultigraph, as there may be multiple flightsfrom one airport to some other airport duringthe same day.
In such models, vertices represent intersectionsand edges represent roads.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 11 / 33
Graph Models
Graph models VI
Biological networks
Many aspects of the biological sciences can be modeled using graphs.
Each species is represented by a vertex. Anundirected edge connects two vertices if thetwo species represented by these verticescompete, i.e., some of the resources they useare the same.
A protein interaction in a living cell occurswhen two or more proteins in that cell bind toperform a biological function.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 12 / 33
Graph Models
Graph models VI
Biological networks
Many aspects of the biological sciences can be modeled using graphs.Each species is represented by a vertex. Anundirected edge connects two vertices if thetwo species represented by these verticescompete, i.e., some of the resources they useare the same.
A protein interaction in a living cell occurswhen two or more proteins in that cell bind toperform a biological function.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 12 / 33
Graph Models
Graph models VI
Biological networks
Many aspects of the biological sciences can be modeled using graphs.Each species is represented by a vertex. Anundirected edge connects two vertices if thetwo species represented by these verticescompete, i.e., some of the resources they useare the same.
A protein interaction in a living cell occurswhen two or more proteins in that cell bind toperform a biological function.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 12 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Basic concepts for undirected graphs
Neighbors
Two vertices u and v in an undirected graph G are called adjacent(or neighbors) in G if u and v are endpoints of an edge e of G .
Neighborhood
The set of all neighbors of a vertex v of G = (V ,E ), denoted byN(v), is called the neighborhood of v . If A is a subset of V , wedenote by N(A) the set of all vertices in G that are adjacent to atleast one vertex in A. So, N(A) =
⋃v∈AN(v).
Degree
The degree of a vertex in an undirected graph is # edges incidentwith it, except that a loop at a vertex contributes twice to the degreeof that vertex. The degree of the vertex v is denoted by deg(v).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 13 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Basic concepts for undirected graphs
Neighbors
Two vertices u and v in an undirected graph G are called adjacent(or neighbors) in G if u and v are endpoints of an edge e of G .
Neighborhood
The set of all neighbors of a vertex v of G = (V ,E ), denoted byN(v), is called the neighborhood of v . If A is a subset of V , wedenote by N(A) the set of all vertices in G that are adjacent to atleast one vertex in A. So, N(A) =
⋃v∈AN(v).
Degree
The degree of a vertex in an undirected graph is # edges incidentwith it, except that a loop at a vertex contributes twice to the degreeof that vertex. The degree of the vertex v is denoted by deg(v).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 13 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Basic concepts for undirected graphs
Neighbors
Two vertices u and v in an undirected graph G are called adjacent(or neighbors) in G if u and v are endpoints of an edge e of G .
Neighborhood
The set of all neighbors of a vertex v of G = (V ,E ), denoted byN(v), is called the neighborhood of v . If A is a subset of V , wedenote by N(A) the set of all vertices in G that are adjacent to atleast one vertex in A. So, N(A) =
⋃v∈AN(v).
Degree
The degree of a vertex in an undirected graph is # edges incidentwith it, except that a loop at a vertex contributes twice to the degreeof that vertex. The degree of the vertex v is denoted by deg(v).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 13 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Example
What are the degrees and what are the neighborhoods of the verticesin the graph displayed in the figure?
N(a) = {b, d , e},N(b) = {a, b, c , d , e},N(c) = {b},N(d) = {a, b, e},N(e) = {a, b, d}, .
deg(a) = 4
deg(b) = 6
deg(c) = 1
deg(d) = 5
deg(e) = 6.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 14 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Some important conclusions in undirected graphs
The Handshaking theorem
Let G = (V ,E ) be an undirected graph with m edges. Then
2m =∑v∈V
deg(v).
(Note that this applies even if multiple edges and loops are present.)
An undirected graph has an even number of vertices of odd degree.Proof: Let V1 and V2 be the set of vertices of even and odd degreesin an undirected graph G = (V ,E ) with m edges. Then
2m =∑v∈V
deg(v) =∑v∈V1
deg(v) +∑v∈V2
deg(v).
Thus, there are an even number of vertices of odd degree.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 15 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Some important conclusions in undirected graphs
The Handshaking theorem
Let G = (V ,E ) be an undirected graph with m edges. Then
2m =∑v∈V
deg(v).
(Note that this applies even if multiple edges and loops are present.)
An undirected graph has an even number of vertices of odd degree.Proof: Let V1 and V2 be the set of vertices of even and odd degreesin an undirected graph G = (V ,E ) with m edges. Then
2m =∑v∈V
deg(v) =∑v∈V1
deg(v) +∑v∈V2
deg(v).
Thus, there are an even number of vertices of odd degree.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 15 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Some important conclusions in undirected graphs
The Handshaking theorem
Let G = (V ,E ) be an undirected graph with m edges. Then
2m =∑v∈V
deg(v).
(Note that this applies even if multiple edges and loops are present.)
An undirected graph has an even number of vertices of odd degree.Proof: Let V1 and V2 be the set of vertices of even and odd degreesin an undirected graph G = (V ,E ) with m edges. Then
2m =∑v∈V
deg(v) =∑v∈V1
deg(v) +∑v∈V2
deg(v).
Thus, there are an even number of vertices of odd degree.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 15 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Basic concepts for directed graphs
Adjacent
When (u, v) is an edge of the graph G with directed edges, u is saidto be adjacent to v and v is said to be adjacent from u. The vertexu is called the initial vertex of (u, v), and v is called the terminal orend vertex of (u, v). The initial vertex and terminal vertex of a loopare the same.
Degree
In a graph with directed edges the in-degree of a vertex v , denoted bydeg−(v), is # edges with v as their terminal vertex. The out-degreeof v , denoted by deg+(v), is # edges with v as their initial vertex.(Note that a loop at a vertex contributes 1 to both the in-degree andthe out-degree of this vertex.)
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 16 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Basic concepts for directed graphs
Adjacent
When (u, v) is an edge of the graph G with directed edges, u is saidto be adjacent to v and v is said to be adjacent from u. The vertexu is called the initial vertex of (u, v), and v is called the terminal orend vertex of (u, v). The initial vertex and terminal vertex of a loopare the same.
Degree
In a graph with directed edges the in-degree of a vertex v , denoted bydeg−(v), is # edges with v as their terminal vertex. The out-degreeof v , denoted by deg+(v), is # edges with v as their initial vertex.(Note that a loop at a vertex contributes 1 to both the in-degree andthe out-degree of this vertex.)
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 16 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Degrees on directed graphs
Theorem
Let G = (V ,E ) be a directed graph, Then∑v∈V
deg−(v) =∑v∈V
deg+(v) = |E |.
What are in-degree and out-degree of the vertices in the graph dis-played in the figure?
deg(a)+ = 4, deg(a)− = 2
deg(b)+ = 1, deg(b)− = 2
deg(c)+ = 2, deg(c)− = 3
deg(d)+ = 2, deg(d)− = 2
deg(e)+ = 3, deg(e)− = 3
deg(f )+ = 0, deg(f )− = 0
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 17 / 33
Graph Terminology and Special Types of Graphs Basic terminology
Degrees on directed graphs
Theorem
Let G = (V ,E ) be a directed graph, Then∑v∈V
deg−(v) =∑v∈V
deg+(v) = |E |.
What are in-degree and out-degree of the vertices in the graph dis-played in the figure?
deg(a)+ = 4, deg(a)− = 2
deg(b)+ = 1, deg(b)− = 2
deg(c)+ = 2, deg(c)− = 3
deg(d)+ = 2, deg(d)− = 2
deg(e)+ = 3, deg(e)− = 3
deg(f )+ = 0, deg(f )− = 0
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 17 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Complete graphs
Definition
A complete graph on n vertices, denoted by Kn, is a simple graphthat contains exactly one edge between each pair of distinct vertices.
A complete graph is also called clique.
A simple graph for which there is at least one pair of distinctvertex not connected by an edge is called non-complete.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 18 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Complete graphs
Definition
A complete graph on n vertices, denoted by Kn, is a simple graphthat contains exactly one edge between each pair of distinct vertices.
A complete graph is also called clique.
A simple graph for which there is at least one pair of distinctvertex not connected by an edge is called non-complete.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 18 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Cycles and wheels
A cycle Cn, n ≥ 3, consists of n vertices v1, v2, · · · , vn and edges{v1, v2}, {v2, v3}, · · · , {vn−1, vn}, and {vn, v1}.
We obtain a wheel Wn when we add an additional vertex v to a cycleCn, for n ≥ 3, and connect v to each of the n vertices in Cn.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 19 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Cycles and wheels
A cycle Cn, n ≥ 3, consists of n vertices v1, v2, · · · , vn and edges{v1, v2}, {v2, v3}, · · · , {vn−1, vn}, and {vn, v1}.
We obtain a wheel Wn when we add an additional vertex v to a cycleCn, for n ≥ 3, and connect v to each of the n vertices in Cn.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 19 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
n-Cubes
An n-dimensional hypercube, or n-cube, denoted by Qn, is a graphthat has vertices representing the 2n bit strings of length n. Twovertices are adjacent if and only if the bit strings that they representdiffer in exactly one bit position.
We can construct the (n + 1)-cube Qn+1 from Qn by making twocopies of Qn, prefacing the labels on the vertices with a 0 in onecopy of Qn and with a 1 in the other copy of Qn, and adding edgesconnecting two vertices that have labels differing only in the first bit.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 20 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
n-Cubes
An n-dimensional hypercube, or n-cube, denoted by Qn, is a graphthat has vertices representing the 2n bit strings of length n. Twovertices are adjacent if and only if the bit strings that they representdiffer in exactly one bit position.
We can construct the (n + 1)-cube Qn+1 from Qn by making twocopies of Qn, prefacing the labels on the vertices with a 0 in onecopy of Qn and with a 1 in the other copy of Qn, and adding edgesconnecting two vertices that have labels differing only in the first bit.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 20 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
n-Cubes
An n-dimensional hypercube, or n-cube, denoted by Qn, is a graphthat has vertices representing the 2n bit strings of length n. Twovertices are adjacent if and only if the bit strings that they representdiffer in exactly one bit position.
We can construct the (n + 1)-cube Qn+1 from Qn by making twocopies of Qn, prefacing the labels on the vertices with a 0 in onecopy of Qn and with a 1 in the other copy of Qn, and adding edgesconnecting two vertices that have labels differing only in the first bit.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 20 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Bipartite graphs
A simple graph G is called bipartite if its vertex set V can be parti-tioned into two disjoint sets V1 and V2 such that every edge in thegraph connects a vertex in V1 and a vertex in V2 (so that no edgein G connects either two vertices in V1 or two vertices in V2). Whenthis condition holds, we call the pair (V1,V2) a bipartition of thevertex set V of G .
C6 is bipartite because itsvertex set can bepartitioned into the twosets V1 = {v1, v3, v5} andV2 = {v2, v4, v6}, andevery edge of C6 connectsa vertex in V1 and a vertexin V2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 21 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Bipartite graphs
A simple graph G is called bipartite if its vertex set V can be parti-tioned into two disjoint sets V1 and V2 such that every edge in thegraph connects a vertex in V1 and a vertex in V2 (so that no edgein G connects either two vertices in V1 or two vertices in V2). Whenthis condition holds, we call the pair (V1,V2) a bipartition of thevertex set V of G .
C6 is bipartite because itsvertex set can bepartitioned into the twosets V1 = {v1, v3, v5} andV2 = {v2, v4, v6}, andevery edge of C6 connectsa vertex in V1 and a vertexin V2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 21 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Examples
Are the graphs G and H displayed in the figure bipartite?
Is there an efficient way to determine whether a graph is a bipartite?
Theorem
A simple graph is bipartite if and only if it is possible to assign oneof two different colors to each vertex of the graph so that no twoadjacent vertices are assigned the same color.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 22 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Examples
Are the graphs G and H displayed in the figure bipartite?
Is there an efficient way to determine whether a graph is a bipartite?
Theorem
A simple graph is bipartite if and only if it is possible to assign oneof two different colors to each vertex of the graph so that no twoadjacent vertices are assigned the same color.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 22 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof
Proof.⇒:First, suppose that G = (V ,E ) is a bipartite simple graph. ThenV = V1 ∪ V2, where V1 and V2 are disjoint sets and every edge inE connects a vertex in V1 and a vertex in V2. If we assign one colorto each vertex in V1 and a second color to each vertex in V2, thenno two adjacent vertices are assigned the same color.
⇐:Now suppose that it is possible to assign colors to the vertices ofthe graph using just two colors so that no two adjacent vertices areassigned the same color. Let V1 be the set of vertices assigned onecolor and V2 be the set of vertices assigned the other color. Then,V1 and V2 are disjoint and V = V1 ∪ V2. Furthermore, every edgeconnects a vertex in V1 and a vertex in V2 because no two adjacentvertices are either both in V1 or both in V2. Consequently, G isbipartite.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 23 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof
Proof.⇒:First, suppose that G = (V ,E ) is a bipartite simple graph. ThenV = V1 ∪ V2, where V1 and V2 are disjoint sets and every edge inE connects a vertex in V1 and a vertex in V2. If we assign one colorto each vertex in V1 and a second color to each vertex in V2, thenno two adjacent vertices are assigned the same color.⇐:Now suppose that it is possible to assign colors to the vertices ofthe graph using just two colors so that no two adjacent vertices areassigned the same color. Let V1 be the set of vertices assigned onecolor and V2 be the set of vertices assigned the other color. Then,V1 and V2 are disjoint and V = V1 ∪ V2. Furthermore, every edgeconnects a vertex in V1 and a vertex in V2 because no two adjacentvertices are either both in V1 or both in V2. Consequently, G isbipartite.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 23 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Complete bipartite graphs
A complete bipartite graph Km,n is a graph that has its vertex setpartitioned into two subsets of m and n vertices, respectively withan edge between two vertices if and only if one vertex is in the firstsubset and the other vertex is in the second subset.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 24 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Complete bipartite graphs
A complete bipartite graph Km,n is a graph that has its vertex setpartitioned into two subsets of m and n vertices, respectively withan edge between two vertices if and only if one vertex is in the firstsubset and the other vertex is in the second subset.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 24 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Matching
Definition
A matching M in a simple graph G = (V ,E ) is a subset of the set Eof edges of the graph such that no two edges are incident with thesame vertex.
A maximum matching is a matchingwith the largest number of edges.
A matching M in a bipartite graphG = (V ,E ) with bipartition(V1,V2) is a complete matchingfrom V1 to V2 if every vertex in V1
is the endpoint of an edge in thematching, or equivalently, if|M| = |V1|.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 25 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Matching
Definition
A matching M in a simple graph G = (V ,E ) is a subset of the set Eof edges of the graph such that no two edges are incident with thesame vertex.
A maximum matching is a matchingwith the largest number of edges.
A matching M in a bipartite graphG = (V ,E ) with bipartition(V1,V2) is a complete matchingfrom V1 to V2 if every vertex in V1
is the endpoint of an edge in thematching, or equivalently, if|M| = |V1|.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 25 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Hall’S Marriage theorem
Theorem
The bipartite graph G = (V ,E ) with bipartition (V1,V2) has a com-plete matching from V1 to V2 if and only if |N(A)| ≥ |A| for allsubsets A of V1.
Proof.⇒:Suppose that there is a complete matching M from V1 to V2.Then, if A ⊂ V1, for every vertex v ∈ A, there is an edge in Mconnecting v to a vertex in V2. Consequently, there are at least asmany vertices in V2 that are neighbors of vertices in V1 as there arevertices in V1. It follows that |N(A)| ≥ |A|.⇐:Basis step: If |V1| = 1, it follows since V1 contains a singlevertex.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 26 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Hall’S Marriage theorem
Theorem
The bipartite graph G = (V ,E ) with bipartition (V1,V2) has a com-plete matching from V1 to V2 if and only if |N(A)| ≥ |A| for allsubsets A of V1.
Proof.⇒:Suppose that there is a complete matching M from V1 to V2.Then, if A ⊂ V1, for every vertex v ∈ A, there is an edge in Mconnecting v to a vertex in V2. Consequently, there are at least asmany vertices in V2 that are neighbors of vertices in V1 as there arevertices in V1. It follows that |N(A)| ≥ |A|.⇐:Basis step: If |V1| = 1, it follows since V1 contains a singlevertex.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 26 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem
Proof:Inductive step: Let k be a positive integer. If G = (V ,E ) is a bi-partite graph with bipartition (V1,V2), and |V1| = j ≤ k, then thereis a complete matching M from V1 to V2 whenever the conditionthat |N(A)| ≥ |A| for all A ⊂ V1 is met.
Now suppose that H = (W ,F ) is a bipartite graph with bipartition(W1,W2) and |W1| = k + 1.Case I: Suppose ∀j ∈ Z+ with 1 ≤ j ≤ k , the vertices in every subsetof j elements from W1 are adjacent to at least j + 1 elements of W2.Then, we select a vertex v ∈ W1 and an element w ∈ N({v}) with|N({v})| ≥ |{v}| = 1. We delete v and w and all edges incident tothem from H. This produces a bipartite graph H
′with bipartition
(W1 − {v},W2 − {w}). Because |W1 − {v}| = k , the inductivehypothesis tells us there is a complete matching from W1 − {v} toW2−{w}. Adding the edge from v to w to this complete matchingproduces a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 27 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem
Proof:Inductive step: Let k be a positive integer. If G = (V ,E ) is a bi-partite graph with bipartition (V1,V2), and |V1| = j ≤ k, then thereis a complete matching M from V1 to V2 whenever the conditionthat |N(A)| ≥ |A| for all A ⊂ V1 is met.Now suppose that H = (W ,F ) is a bipartite graph with bipartition(W1,W2) and |W1| = k + 1.
Case I: Suppose ∀j ∈ Z+ with 1 ≤ j ≤ k , the vertices in every subsetof j elements from W1 are adjacent to at least j + 1 elements of W2.Then, we select a vertex v ∈ W1 and an element w ∈ N({v}) with|N({v})| ≥ |{v}| = 1. We delete v and w and all edges incident tothem from H. This produces a bipartite graph H
′with bipartition
(W1 − {v},W2 − {w}). Because |W1 − {v}| = k , the inductivehypothesis tells us there is a complete matching from W1 − {v} toW2−{w}. Adding the edge from v to w to this complete matchingproduces a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 27 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem
Proof:Inductive step: Let k be a positive integer. If G = (V ,E ) is a bi-partite graph with bipartition (V1,V2), and |V1| = j ≤ k, then thereis a complete matching M from V1 to V2 whenever the conditionthat |N(A)| ≥ |A| for all A ⊂ V1 is met.Now suppose that H = (W ,F ) is a bipartite graph with bipartition(W1,W2) and |W1| = k + 1.Case I: Suppose ∀j ∈ Z+ with 1 ≤ j ≤ k , the vertices in every subsetof j elements from W1 are adjacent to at least j + 1 elements of W2.Then, we select a vertex v ∈ W1 and an element w ∈ N({v}) with|N({v})| ≥ |{v}| = 1. We delete v and w and all edges incident tothem from H. This produces a bipartite graph H
′with bipartition
(W1 − {v},W2 − {w}). Because |W1 − {v}| = k , the inductivehypothesis tells us there is a complete matching from W1 − {v} toW2−{w}. Adding the edge from v to w to this complete matchingproduces a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 27 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem Cont’d
Proof:Case II: Suppose that for some j with 1 ≤ j ≤ k , there is a subsetW
′1 of j vertices such that there are exactly j neighbors of these
vertices in W2. Let W′2 be the set of these neighbors. Then, by the
inductive hypothesis there is a complete matching from W′1 to W
′2.
Remove these 2j vertices from W1 and W2 and all incident edges toproduce a bipartite graph K with bipartition (W1 −W
′1,W2 −W
′2).
We will show that the graph K satisfies the condition |N(A)| ≥ |A|for all subsets A of W1 −W
′1. If not, there would be a subset of t
vertices of W1 −W′1 where 1 ≤ t ≤ k + 1− j such that the vertices
in this subset have fewer than t vertices of W2 −W′2 as neighbors.
Then, the set of j + t vertices of W1 consisting of these t verticestogether with the j vertices we removed from W1 has fewer than j+tneighbors in W2, contradicting the hypothesis that |N(A)| ≥ |A| forall A ⊂W1.Hence, we obtain a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 28 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem Cont’d
Proof:Case II: Suppose that for some j with 1 ≤ j ≤ k , there is a subsetW
′1 of j vertices such that there are exactly j neighbors of these
vertices in W2. Let W′2 be the set of these neighbors. Then, by the
inductive hypothesis there is a complete matching from W′1 to W
′2.
Remove these 2j vertices from W1 and W2 and all incident edges toproduce a bipartite graph K with bipartition (W1 −W
′1,W2 −W
′2).
We will show that the graph K satisfies the condition |N(A)| ≥ |A|for all subsets A of W1 −W
′1. If not, there would be a subset of t
vertices of W1 −W′1 where 1 ≤ t ≤ k + 1− j such that the vertices
in this subset have fewer than t vertices of W2 −W′2 as neighbors.
Then, the set of j + t vertices of W1 consisting of these t verticestogether with the j vertices we removed from W1 has fewer than j+tneighbors in W2, contradicting the hypothesis that |N(A)| ≥ |A| forall A ⊂W1.
Hence, we obtain a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 28 / 33
Graph Terminology and Special Types of Graphs Some Special Simple Graphs
Proof of Hall’S Marriage theorem Cont’d
Proof:Case II: Suppose that for some j with 1 ≤ j ≤ k , there is a subsetW
′1 of j vertices such that there are exactly j neighbors of these
vertices in W2. Let W′2 be the set of these neighbors. Then, by the
inductive hypothesis there is a complete matching from W′1 to W
′2.
Remove these 2j vertices from W1 and W2 and all incident edges toproduce a bipartite graph K with bipartition (W1 −W
′1,W2 −W
′2).
We will show that the graph K satisfies the condition |N(A)| ≥ |A|for all subsets A of W1 −W
′1. If not, there would be a subset of t
vertices of W1 −W′1 where 1 ≤ t ≤ k + 1− j such that the vertices
in this subset have fewer than t vertices of W2 −W′2 as neighbors.
Then, the set of j + t vertices of W1 consisting of these t verticestogether with the j vertices we removed from W1 has fewer than j+tneighbors in W2, contradicting the hypothesis that |N(A)| ≥ |A| forall A ⊂W1.Hence, we obtain a complete matching from W1 to W2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 28 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Subgraph
Subgraph
A subgraph of a graphG = (V ,E ) is a graphH = (W ,F ), where W ⊆ V andF ⊆ E . A subgraph H of G is aproper subgraph of G if H = G .
Induced subgraphs
Let G = (V ,E ) be a simple graph. The subgraph induced by asubset W of the vertex set V is the graph (W ,F ), where the edgeset F contains an edge in E if and only if both endpoints of this edgeare in W .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 29 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Subgraph
Subgraph
A subgraph of a graphG = (V ,E ) is a graphH = (W ,F ), where W ⊆ V andF ⊆ E . A subgraph H of G is aproper subgraph of G if H = G .
Induced subgraphs
Let G = (V ,E ) be a simple graph. The subgraph induced by asubset W of the vertex set V is the graph (W ,F ), where the edgeset F contains an edge in E if and only if both endpoints of this edgeare in W .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 29 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Subgraph
Subgraph
A subgraph of a graphG = (V ,E ) is a graphH = (W ,F ), where W ⊆ V andF ⊆ E . A subgraph H of G is aproper subgraph of G if H = G .
Induced subgraphs
Let G = (V ,E ) be a simple graph. The subgraph induced by asubset W of the vertex set V is the graph (W ,F ), where the edgeset F contains an edge in E if and only if both endpoints of this edgeare in W .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 29 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Remove or adding edges of a graph
Remove
Given a graph G = (V ,E ) and an edge e ∈ E , we can produce asubgraph of G by removing the edge e. The resulting subgraph isdenoted G − e = (V ,E − {e}).Similarly, if E
′is a subset of E , we can produce a subgraph of G ,
denoted as (V ,E −E′), by removing the edges in E
′from the graph.
Adding
We can also add an edge e to a graph to produce a new larger graphwhen this edge connects two vertices already in G . We denote byG +e the new graph, denoted as (V ,E ∪{e}), produced by adding anew edge e, connecting two previously non-incident vertices, to thegraph G .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 30 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Remove or adding edges of a graph
Remove
Given a graph G = (V ,E ) and an edge e ∈ E , we can produce asubgraph of G by removing the edge e. The resulting subgraph isdenoted G − e = (V ,E − {e}).Similarly, if E
′is a subset of E , we can produce a subgraph of G ,
denoted as (V ,E −E′), by removing the edges in E
′from the graph.
Adding
We can also add an edge e to a graph to produce a new larger graphwhen this edge connects two vertices already in G . We denote byG +e the new graph, denoted as (V ,E ∪{e}), produced by adding anew edge e, connecting two previously non-incident vertices, to thegraph G .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 30 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Edge contractions and vertices remove
Edge contractions
An edge contraction which removesan edge e with endpoints u and vand merges u and v into a newsingle vertex w , and for each edge
with u or v as an endpoint replaces the edge with one with w asendpoint in place of u or v and with the same second endpoint.
Vertex removing
When we remove a vertex v and all edges incident to it from G =(V ,E ), we produce a subgraph, denoted by G − v = (V − {v},E ′
),where E
′is the set of edges of G not incident to v .
If V′
is a subset of V , then graph G −V′
is subgraph (V −V′,E
′),
where E′
is the set of edges of G not incident to a vertex in V′.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 31 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Edge contractions and vertices remove
Edge contractions
An edge contraction which removesan edge e with endpoints u and vand merges u and v into a newsingle vertex w , and for each edge
with u or v as an endpoint replaces the edge with one with w asendpoint in place of u or v and with the same second endpoint.
Vertex removing
When we remove a vertex v and all edges incident to it from G =(V ,E ), we produce a subgraph, denoted by G − v = (V − {v},E ′
),where E
′is the set of edges of G not incident to v .
If V′
is a subset of V , then graph G −V′
is subgraph (V −V′,E
′),
where E′
is the set of edges of G not incident to a vertex in V′.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 31 / 33
Graph Terminology and Special Types of Graphs New Graphs from Old
Graph union
Definition
The union of two simplegraphs G1 = (V1,E1) andG2 = (V2,E2) is the simplegraph with vertex set V1 ∪ V2
and edge set E1 ∪ E2. Theunion of G1 and G2 is denotedby G1 ∪ G2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 32 / 33
Take-aways
Take-aways
Conclusions
Graphs
Graph models
Graph terminology and special types of graphs
Basic terminologySome special simple graphsNew graphs from old
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Jun. 15, 2020 33 / 33
top related