0% found this document useful (0 votes)
58 views18 pages

Graph Theory Introduction L 1 PDF

66

Uploaded by

bubunadef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views18 pages

Graph Theory Introduction L 1 PDF

66

Uploaded by

bubunadef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Introduction to Graphs

Graphs
Definition: A graph G = (V, E) consists of a
nonempty set V of vertices (or nodes) and a set
E of edges. Each edge has either one or two
vertices associated with it, called its endpoints.
An edge is said to connect its endpoints.
Example: This is a graph with four vertices and five edges.

a b

d c
Remarks:
We have a lot of freedom when we draw a picture of a
graph. All that matters is the connections made by the
edges, not the particular geometry depicted. For example,
the lengths of edges, whether edges cross, how vertices are
depicted, and so on, do not matter
A graph with an infinite vertex set is called an infinite
graph. A graph with a finite vertex set is called a finite
graph. We restrict our attention to finite graphs.
Some Terminology
• In a simple graph each edge connects two
different vertices and no two edges connect
the same pair of vertices.
• Multigraphs may have multiple edges
connecting the same two vertices. When m
different edges connect the vertices u and v,
we say that {u,v} is an edge of multiplicity m.
Some Terminology
• An edge that connects a vertex to itself is
called a loop.
• A pseudo graph may include loops, as well as
multiple edges connecting the same pair of
vertices.
Example:

This pseudo graph has both multiple edges and


loops.
a b

c
Directed Graphs
Definition: An directed graph (or digraph) G = (V, E)
consists of a nonempty set V of vertices (or
nodes) and a set E of directed edges (or arcs).
Each edge is associated with an ordered pair of
vertices. The directed edge associated with the
ordered pair (u,v) is said to start at u and end at
v.
Remark:
– Graphs where the end points of an edge are not
ordered are said to be undirected graphs.
Let (u,v) be an edge in G. Then u is the initial
vertex of this edge and is adjacent to v and v is
the terminal (or end) vertex of this edge and is
adjacent from u. The initial and terminal vertices
of a loop are the same.
Some Terminology (continued)
A simple directed graph has no loops and no
multiple edges.
b
a

c
Example:

This is a directed graph with three vertices and four edges.


A directed multigraph may have multiple directed
edges. When there are m directed edges from the vertex
u to the vertex v, we say that (u,v) is an edge of
multiplicity m.

Example:

a b

In this directed multigraph the multiplicity of (a,b) is 1


and the multiplicity of (b,c) is 2.
Some Terminology (continued)
Definition 1. Two vertices u, v in an undirected
graph G are called adjacent (or neighbors) in G if
there is an edge e between u and v. Such an edge e
is called incident with the vertices u and v and e is
said to connect u and v.

Definition 2. The degree of a vertex in a undirected


graph is the number of edges incident with it, except
that a loop at a vertex contributes two to the degree of
that vertex. The degree of the vertex v is denoted by
deg(v).
Degrees and Neighborhoods of Vertices

Example: What are the degrees and


neighborhoods of the vertices in the graphs G
and H?
Solution:
G: deg(a) = 2, deg(b) = deg(c) = deg(f ) = 4, deg(d ) = 1,
deg(e) = 3, deg(g) = 0.
N(a) = {b, f }, N(b) = {a, c, e, f }, N(c) = {b, d, e, f },
N(d) = {c}, N(e) = {b, c , f }, N(f) = {a, b, c, e}, N(g) = 
.
H: deg(a) = 4, deg(b) = deg(e) = 6, deg(c) = 1, deg(d) = 5.
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}.
Directed Graphs (continued)
Definition: The in-degree of a vertex v, denoted
deg−(v), is the number of edges which terminate
at v. The out-degree of v, denoted deg+(v), is the
number of edges with v as their initial vertex.
Note that a loop at a vertex contributes 1 to
both the in-degree and the out-degree of the
vertex.
Example:
In the graph G we have

deg−(a) = 2, deg−(b) = 2, deg−(c) = 3, deg−(d) = 2, deg−(e) = 3, deg−(f) = 0.

deg+(a) = 4, deg+(b) = 1, deg+(c) = 2, deg+(d) = 2, deg+ (e) = 3, deg+(f) = 0.


Directed Graphs (continued)
Theorem 3: Let G = (V, E) be a graph with
directed edges. Then:

Proof: The first sum counts the number of


outgoing edges over all vertices and the second
sum counts the number of incoming edges over
all vertices. It follows that both sums equal the
number of edges in the graph.
Theorem 1 (Handshaking Theorem): If G = (V,E) is an undirected graph with e
edges, then 𝟐𝒆 = σ𝒗∈𝑽 𝒅𝒆𝒈(𝒗)

Proof:
Each edge contributes twice to the degree
count of all vertices. Hence, both the left-hand
and right-hand sides of this equation equal
twice the number of edges.
Handshaking Theorem
Example: How many edges are there in a graph with
10 vertices of degree six?
Solution: Because the sum of the degrees of the
vertices is 6  10 = 60, the handshaking
theorem tells us that 2m = 60. So the number of
edges m = 30.

Example: If a graph has 5 vertices, can each vertex


have degree 3?
Solution: This is not possible by the handshaking
thorem, because the sum of the degrees of the vertices 3
 5 = 15 is odd.
Degree of Vertices (continued)
Theorem 2: The number of vertices with odd degree is always
even.
Proof: Let V1 be the vertices of even degree and V2 be the
vertices of odd degree in an undirected graph G = (V, E) with
m edges. Then

This sum must be even because 2m is


must be even
even and the sum of the degrees of
since deg(v)
the vertices of even degrees is also
is even for
even. Because this is the sum of the
each v ∈ V1
degrees of all vertices of odd degree
in the graph, there must be an even
number of such vertices.

You might also like