0% found this document useful (0 votes)
2 views44 pages

Module 4 Graph Theory 2

The document provides an overview of graph theory, including definitions, types of graphs, and their applications. It covers concepts such as Euler paths and circuits, Hamiltonian circuits, and the Traveling Salesman Problem, along with their historical context and relevance in various fields. The module aims to equip students with the ability to describe and identify different graph types and representations.

Uploaded by

shortestdemon
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)
2 views44 pages

Module 4 Graph Theory 2

The document provides an overview of graph theory, including definitions, types of graphs, and their applications. It covers concepts such as Euler paths and circuits, Hamiltonian circuits, and the Traveling Salesman Problem, along with their historical context and relevance in various fields. The module aims to equip students with the ability to describe and identify different graph types and representations.

Uploaded by

shortestdemon
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/ 44

< > section name

MODULE 4: Graph Theory


file < >

Graph Theory and Graphs


Types of Graphs
Undirected Graph
Directed Graph
Indegree
Outdegree
Weighted Graph
Unweighted Graph
< > section name

MODULE 4: Graph Theory


file < >

At the end of the module, the students should be able to


recall and describe graph theory and graph
list, describe and identify the different types of
graph
recall and describe graph representations
list, describe and identify the different types of
graph representations
< > section name

History
file < >

Texts typically trace the origin of graph


theory to the Konigsberg Bridge
Problem and Its solution by Leonhard
Euler (1736). The book describes the
problem and the history behind it.
< > section name

History
file < >

On p.229, the book mentions the


application of graphs to printed circuit
and microchip design.
Graphs seem an intuitively natural way
to model many situations in the creation
(connections of wires/leads,
logistics/transportations problems,
pipelines between points with known
capacities, family trees, organizational
charts and more.)
< > section name

Application
file < >

1. Finding communities in networks, such as


social media (friend/connection
recommendations), or in the recent days for
possible spread of COVID19 in the
community through contacts.
2. Ranking/ordering hyperlinks in search
engines.
3. GPS/Google maps to find the shortest path
home.
4. Study of molecules and atoms in
chemistry.
5. DNA sequencing
< > section name

Definition
file < >

What is a graph?

A graph is pictorial representation of a set of objects where


some pairs of objects are connected by a link. The interconnected
objects are represented by points termed as vertices, and the links
that connect the vertices are called edges.
< > section name

Definition
file < >

Formally, a graphs is a pair of sets (V,E) where V is the set of


vertices and E is the set of edges, connecting the pairs of vertices.
< > section name

Example
file < >
< > section name

Example
file < >
< > section name

Example
file < >
< > section name

Definition
file < >

A point is a particular position in a one-dimensional, two-


dimensional, or three-dimensional space.

A point can be denoted an alphabet. Represented with a dot

a
< > section name

Definition
file < >

A line is a connection between two points. It can be represented


with a solid line

a b
< > section name

Definition
file < >

A vertex is a point where multiple lines meet. Also called node.

A vertex can also be denoted an alphabet.

a
< > section name

Definition
file < >

A pendant vertex is a vertex with a degree one.

a b
< > section name

Definition
file < >

An isolated vertex is a vertex with a degree zero.

a b
< > section name

Definition
file < >

An edge is the mathematical term for a line that connects two


vertices.
Many edges can be formed from a single vertex. Without a vertex,
an edge cannot be formed.
There must be a starting vertex and an ending a vertex for an edge

a b
< > section name

Definition
file < >

A loop is drawn from vertex to itself

v is a vertex for which it has


an edge (v,v) forming a loop

v
< > section name

Types of Graph
file < >

UNDIRECTED GRAPH. DIRECTED GRAPH.


Has no directed Each vertex has an
edges. indegree and an
outdegree
< > section name

Example
file < >

Indegree of a graph.
the indegree of vertex is the number of edges coming toward the vertex
Outdegree of a graph
the outdegree of vertex is the number of edges coming away from the vertex

Vertex Indegree Outdegree


A
B
C
D
E
< > section name

Example
file < >

Indegree of a graph.
the indegree of vertex is the number of edges coming toward the vertex
Outdegree of a graph
the outdegree of vertex is the number of edges coming away from the vertex

Vertex Indegree Outdegree


e A
d
B
C
b D
c
E
< > section name

Types of Graph
file < >

WEIGHTED GRAPH.
UNWEIGHTED GRAPH
Has value on its edges
has no value on its
edges
< > section name

Adjacency Matrix
file < >

An adjacency matrix is a way of representing a graph as a matrix of booleans (0's


and 1's). A finite graph can be represented in the form of a square matrix on a
computer, where the boolean value of the matrix indicates if there is a direct path
between two vertices.
< > section name

Example
file < >

Determine the adjacency matrix

e
d

b
c
< > section name

Clear points
file < >

1. The two vertices u and v are end vertices of the edge (u, v).
2. Edges that have the same end vertices are parallel.
3. An edge of the form (v, v) is a loop.
4. A graph is simple if it has no parallel edges or loops.
5. A graph with no edges (i.e. E is empty) is empty.
6. A graph with no vertices (i.e. V and E are empty) is a null graph.
7. A graph with only one vertex is trivial.
8. Edges are adjacent if they share a common end vertex.
9. Two vertices u and v are adjacent if they are connected by an edge, in other words, (u, v)
is an edge.
10. The degree of the vertex v, written as d(v), is the number of edges with v as an end vertex.
By convention, we count a loop twice and parallel edges contribute separately.
11. A pendant vertex is a vertex whose degree is 1.
12. An edge that has a pendant vertex as an end vertex is a pendant edge.
13. An isolated vertex is a vertex whose degree is 0.
< > section name

Example: TRUE or FALSE


file < >

v4 and v5 are end vertices of e5.


e4 and e3 are parallel.
e3 is a loop.
The graph is not simple.
e1 and e2 are adjacent.
v1 and v2 are adjacent.
The degree of v1 is 1 so it is a pendant vertex.
e1 is a pendant edge.
The degree of v5 is 4.
The degree of v4 is 4.
The degree of v3 is 0 so it is an isolated vertex
< > section name

Euler Path
file < >

Is a path that uses every edge in a graph with no repeats. Being a path, it does not have to
return to the starting vertex

b d b

c a c

a
d
< > section name

Euler Circuit
file < >

Is a circuit that uses every edge in a graph with no repeats. Being a circuit, it must start at
the same vertex

c b

d e
< > section name

Euler’s Path and Circuit Theorems


file < >

1. A graph will contain an Euler path if it contains at most two vertices of odd degree.
2. A graph will contain an Euler circuit if all vertices have even degree.
Note: These theorems do not tell us how to find the Euler path or Euler circuit

Degree of a Vertex
The degree or valence of a vertex is the number of edges meeting at that vertex. It is
possible for a vertex to have a degree of zero or larger

a b c d e
< > section name

Example
file < >

Determine if each graph has a Euler path. If it has one, find an Euler path.
< > section name

Example
file < >

Determine if each graph has a Euler circuit. If it has one, find an Euler circuit.
< > section name

Example
file < >

Determine if each graph has a Euler circuit. If it has one, find an Euler circuit.
< > section name

Euler Circuits
file < >

Why do we care if an Euler circuit exists?


< > section name

Hamiltonian Circuits
file < >

Instead of looking for a circuit that covers every edge once, sometimes we are interested in
a circuit that visits every vertex once.
< > section name

Hamiltonian Circuits and Paths


file < >

A Hamiltonian circuit is a circuit that visits every vertex once with no repeats. Being a
circuit, it must start and end at the same vertex

A Hamiltonian path also visits every vertex once with no repeats, but does not have to
start and end at the same vertex.

Hamiltonian circuits are named for William Rowan Hamilton


who studied them in the 1800’s.
< > section name

Example
file < >

A Hamiltonian circuit is a circuit that visits every vertex once with no repeats. Being a
circuit, it must start and end at the same vertex

A Hamiltonian path also visits every vertex once with no repeats, but does not have to
start and end at the same vertex.
< > section name

Exercise
file < >

Does a Hamiltonian path or circuit exist on the graph below?

With Hamiltonian circuits, our focus will not be on existence, but on the question of
optimization. Given a graph where the edges have weights, we find the optimal
Hamiltonian circuit which would be the one with the lowest total weight.
< > section name

Exercise
file < >

Traveling Salesman Problem (TSP)


The problem is called traveling salesman problem (TSP) because the question can be framed like this:
Suppose a salesman needs to give sales pitches in four cities. He looks up the airfares between each
city and puts the cost in a graph. In what order should he travel to visit each city once then return
home with the lowest cost?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy