0% found this document useful (0 votes)
55 views

Basic Definitions

The document defines basic graph theory terms including: - The degree of a vertex, which is the number of its neighbors - Regular graphs where every vertex has the same degree - The complement of a graph which connects vertices that are not connected in the original graph - Walks and paths, where walks allow repeated edges/vertices and paths do not
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)
55 views

Basic Definitions

The document defines basic graph theory terms including: - The degree of a vertex, which is the number of its neighbors - Regular graphs where every vertex has the same degree - The complement of a graph which connects vertices that are not connected in the original graph - Walks and paths, where walks allow repeated edges/vertices and paths do not
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/ 116

Basic Definitions

Alexander Golovnev
Outline

The Degree of a Vertex

Paths

Connectivity

Directed Graphs

Weighted Graphs
Definitions

An isolated vertex forms a component


Definitions

An isolated vertex forms a component

???
The Degree of a Vertex

The number of friends


The Degree of a Vertex

• The Degree of a vertex is the number of its


incident edges
The Degree of a Vertex

• The Degree of a vertex is the number of its


incident edges

• I.e., the Degree of a vertex is the number of


its neighbors
The Degree of a Vertex

• The Degree of a vertex is the number of its


incident edges

• I.e., the Degree of a vertex is the number of


its neighbors

• The degree of a vertex v is denoted by deg(v)


The Degree of a Vertex

• The Degree of a vertex is the number of its


incident edges

• I.e., the Degree of a vertex is the number of


its neighbors

• The degree of a vertex v is denoted by deg(v)

• The degree of a graph is the maximum degree


of its vertices
The Degree of a Vertex: Examples

The degree of v is 6: deg(v) = 6


The degree of v6 is 1: deg(v6 ) = 1

v6 v5

v1 v v4

v2 v3
The Degree of a Vertex: Examples

The degree of every vertex is 2: ∀i, deg(vi ) = 2

v4 v3

v5 v2

v1
Isolated Vertices

v8
v6 v5

v1 v0 v4

v2 v3
v7
Isolated Vertices
deg(v2 ) = 2

v8
v6 v5

v1 v0 v4

v2 v3
v7
Isolated Vertices
deg(v2 ) = 2
deg(v8 ) = 1

v8
v6 v5

v1 v0 v4

v2 v3
v7
Isolated Vertices
deg(v2 ) = 2
deg(v8 ) = 1
deg(v0 ) = 0. v0 is an Isolated Vertex
v8
v6 v5

v1 v0 v4

v2 v3
v7
Regular Graphs

A Regular graph is
a graph where each
vertex has the same
degree
Regular Graphs

A Regular graph is
a graph where each
vertex has the same
degree
A regular graph of
degree k is also
called k-Regular
Regular Graphs

A Regular graph is
a graph where each
vertex has the same
degree
A regular graph of
degree k is also
called k-Regular
E.g., this graph is 3-
Regular
Complement Graph

• The Complement of a graph G = (V, E) is a


graph G = (V, E) on the same set of vertices V
and the following set of edges:
Complement Graph

• The Complement of a graph G = (V, E) is a


graph G = (V, E) on the same set of vertices V
and the following set of edges:

• Two vertices are connected in G if and only if


they are not connected in G
Complement Graph

• The Complement of a graph G = (V, E) is a


graph G = (V, E) on the same set of vertices V
and the following set of edges:

• Two vertices are connected in G if and only if


they are not connected in G

• I.e., (u, v) ∈ E if and only if (u, v) ̸∈ E


Complement Graph

G G
v2 v1 v2 v1

v3 v6 v3 v6

v4 v5 v4 v5
Complement Graph

G G
v2 v1 v2 v1

v3 v6 v3 v6

v4 v5 v4 v5
Complement Graph

G G
v2 v1 v2 v1

v3 v6 v3 v6

v4 v5 v4 v5
Complement Graph

G G
v2 v1 v2 v1

v3 v6 v3 v6

v4 v5 v4 v5
Complement Graph

G G
v2 v1 v2 v1

v3 v6 v3 v6

v4 v5 v4 v5
Outline

The Degree of a Vertex

Paths

Connectivity

Directed Graphs

Weighted Graphs
Paths

Is there a path from one point to another?


Walks

• A Walk in a graph is a sequence of edges, such


that each edge (except for the first one) starts
with a vertex where the previous edge ended
Walks

• A Walk in a graph is a sequence of edges, such


that each edge (except for the first one) starts
with a vertex where the previous edge ended
• The Length of a walk is the number of edges
in it
Walks

• A Walk in a graph is a sequence of edges, such


that each edge (except for the first one) starts
with a vertex where the previous edge ended
• The Length of a walk is the number of edges
in it
• A Path is a walk where all edges are distinct
Walks

• A Walk in a graph is a sequence of edges, such


that each edge (except for the first one) starts
with a vertex where the previous edge ended
• The Length of a walk is the number of edges
in it
• A Path is a walk where all edges are distinct
• A Simple Path is a walk where all vertices are
distinct
Walks: Examples

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A walk of length 6: (e1 , e2 , e4 , e5 , e3 , e1 )


Not a path: uses e1 twice

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A path of length 4: (e7 , e6 , e4 , e5 )


Not a simple path: visits v2 twice

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A simple path of length 4: (e7 , e6 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A simple path of length 4: (e7 , e6 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A simple path of length 4: (e7 , e6 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A simple path of length 4: (e7 , e6 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

A simple path of length 4: (e7 , e6 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples
It is sometimes convenient to
specify a path (walk) by a list of
its vertices

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Walks: Examples

(v4 , v5 , v2 ) is a path of length 2

v6 e1
e2
v4 v5 e6
v1
e3

e4
e7
e5
v3 v2
Cycles

• A Cycle in a graph is a path whose first vertex


is the same as the last one
Cycles

• A Cycle in a graph is a path whose first vertex


is the same as the last one

• In particular, all the edges in a Cycle are


distinct
Cycles

• A Cycle in a graph is a path whose first vertex


is the same as the last one

• In particular, all the edges in a Cycle are


distinct

• A Simple Cycle is a cycle where all vertices


except for the first one are distinct. (And
there first vertex is taken twice)
Cycles: Examples

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A cycle of length 6: (e2 , e3 , e8 , e4 , e7 , e6 )


Not a simple cycle: visits v5 three times

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A simple cycle of length 4: (e5 , e4 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A simple cycle of length 4: (e5 , e4 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A simple cycle of length 4: (e5 , e4 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A simple cycle of length 4: (e5 , e4 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Cycles: Examples

A simple cycle of length 4: (e5 , e4 , e2 , e3 )

v6 e1
e2
v4 v5 e6
v1
e8
e3

e4
e7
e5
v3 v2
Outline

The Degree of a Vertex

Paths

Connectivity

Directed Graphs

Weighted Graphs
Connected Components

The number of islands


Connectivity

• A graph is called Connected if there is a path


between every pair of its vertices
Connectivity

• A graph is called Connected if there is a path


between every pair of its vertices

• A Connected Component of a graph G is a


maximal connected subgraph of G
Connectivity

• A graph is called Connected if there is a path


between every pair of its vertices

• A Connected Component of a graph G is a


maximal connected subgraph of G

• I.e., a connected subgraph of G which is not


contained in a larger connected subgraph of G
Connected Components: Examples

v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples
v1 , v2 , v3 form a connected subgraph

v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples
v1 , v2 , v3 form a connected subgraph
But not a connected component

v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples
v1 , v2 , v3 form a connected subgraph
But not a connected component

v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples
v1 , v2 , v3 form a connected subgraph
But not a connected component
v1 , v2 , v3 , v4 , v5 , v6 form a Connected Component
v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples

v7 , v8 form a Connected Component


v1 , v2 , v3 , v4 , v5 , v6 form a Connected Component
v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples
v0 forms a Connected Component
v7 , v8 form a Connected Component
v1 , v2 , v3 , v4 , v5 , v6 form a Connected Component
v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples

Each isolated vertex forms a Connected Component


v8
v6 v5

v1 v0 v4

v2 v3
v7
Connected Components: Examples

Each isolated vertex forms a Connected Component


v8
v6 v5

v1 v0 v4

v2 v3
v7
Outline

The Degree of a Vertex

Paths

Connectivity

Directed Graphs

Weighted Graphs
Directed Graphs

One-way Streets
Directed Graphs

Followers
Undirected Edge (Edge)

Edge {u, v}

u v
Directed Edge (Arc)

Arc (u, v)

u v
Directed Edge (Arc)

Arc (u, v)
tail head
u v
Directed Edge (Arc)

Arc (u, v)

u v

+
u v
Directed Edge (Arc)

Arc (u, v)

u v

+
u v
=
u v
The Degree of a Vertex

• The Indegree of a vertex v is the number of


edges ending at v
The Degree of a Vertex

• The Indegree of a vertex v is the number of


edges ending at v

• The Outdegree of a vertex v is the number of


edges leaving v
The Degree of a Vertex: Examples

v2

v1 v3

v4
The Degree of a Vertex: Examples

v2

The Indegree of v3 is 3,
v1 v3
the Outdegree of v3 is 1

v4
The Degree of a Vertex: Examples

v2

The Indegree of v1 is 1,
v1 v3
the Outdegree of v1 is 2

v4
Directed Paths

v2

v1 v3

v4
Directed Paths

v2

(v2 , v3 , v4 ) is a
v1 v3
Path of length 2

v4
Directed Paths

v2

(v1 , v3 , v2 ) is not a Path v1 v3

v4
Outline

The Degree of a Vertex

Paths

Connectivity

Directed Graphs

Weighted Graphs
Weighted Graphs

Distance, Driving Time, etc.


Weighted Graphs: Examples
v2

v5

v4

v6 v7

v1 v3
Weighted Graphs: Examples
v2

2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Graphs: Examples
v2

2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths

• A Weighted Graph associates a weight with


every edge
Weighted Paths

• A Weighted Graph associates a weight with


every edge
• The Weight of a path is the sum of the
weights of its edges
Weighted Paths

• A Weighted Graph associates a weight with


every edge
• The Weight of a path is the sum of the
weights of its edges
• A Shortest Path between two vertices is a
path of the minimum weight
Weighted Paths

• A Weighted Graph associates a weight with


every edge
• The Weight of a path is the sum of the
weights of its edges
• A Shortest Path between two vertices is a
path of the minimum weight
• The Distance between two vertices is the
length of a shortest path between them
Weighted Paths: Examples
v2

2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths: Examples
v2
A path of weight
11 from v1 to v6
2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths: Examples
v2
A path of weight
12 from v1 to v6
2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths: Examples
v2
A path of weight
13 from v1 to v6
2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths: Examples
v2
A path of weight
3 from v1 to v6
2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3
Weighted Paths: Examples

The distance be- v2


tween v1 and v6
is 3
2 v5 2
3 2 3
v4
5 5
4 4
v6 v7
4 2
1
v1 v3

You might also like