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

Module 8 The Mathematics of Graph

This document discusses graphs and graph theory concepts including: - Euler introduced graphs to solve the Konigsberg bridge problem in 1736. - A graph represents connections between vertices using edges. - Key concepts include paths, circuits, degrees of vertices, Eulerian and Hamiltonian graphs. - Weighted graphs assign costs to edges to model real-world optimization problems.

Uploaded by

Erizza Javier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Module 8 The Mathematics of Graph

This document discusses graphs and graph theory concepts including: - Euler introduced graphs to solve the Konigsberg bridge problem in 1736. - A graph represents connections between vertices using edges. - Key concepts include paths, circuits, degrees of vertices, Eulerian and Hamiltonian graphs. - Weighted graphs assign costs to edges to model real-world optimization problems.

Uploaded by

Erizza Javier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MODULE 8: THE MATHEMATICS OF GRAPH - For example, the

diagram in Figure
5.1 could
represent friends
8.1 GRAPHS AND EULER CIRCUITS that are connected
on Facebook.
GRAPH THEORY - Each dot
- Graph theory had its beginning in 1736. represents a
- Pregel River in Konigsberg City (located in person, and a line
modern-day Russia and now called segment connecting
Kaliningrad) two dots means that those two people are
friends on Facebook.
- This type of diagram is called a graph.

WHAT IS A GRAPH?
- A graph is a set of points called vertices and
line segments or curves called edges.

- Pregel River in Konigsberg City surrounded an


island before splitting into two. 7 bridges
crossed the river and connected land areas.

- Two vertices are adjacent if they have a


common edge. Two edges are adjacent if they
share a common vertex.
- A loop is an edge, the endpoints of which are
the same vertex.
- Leonhard Euler (1707-1783)
- In 1736, Euler proved it impossible to walk such
a path.
- His analysis of the challenge laid the
groundwork for a branch of mathematics
known as Graph Theory.
- It took 200 years before the first book on
graph theory was written.
- Graph theory has developed into an extensive Connected graph Disconnected graph
and popular branch of mathematics which has
been applied to many problems in
mathematics, computer science, and other
scientific and not-so-scientific areas.

INTRODUCTION TO GRAPHS
- Think of all the various connections we
experience in our lives - friends are connected
on Facebook, cities are connected by roads, Null graph - no edge is Simple graph - does not
computers are connected across the internet. drawn between any two have more than one
- A branch of mathematics called graph theory vertices edge between two
illustrates and analyzes connections such as vertices and no edge
starts and ends at the
these. same vertex. A graph
without loops and
multiple edges.
graph in Figure 5.4, one path would be
Not a simple graph Complete graph - where
every possible edge is A-B-A-C.
drawn between the
vertices. Closed path
- If a path ends at the same vertex at which it
started, it is considered a closed path or circuit.

A Bipartite graph - if it A Directed graph -


is possible to divide all where all the edges are
its vertices into two directed from one vertex
disjoint subsets such that to another. It is Euler Circuit
every edge in the graph sometimes called a - A circuit that uses every edge but never uses
connects a vertex in one digraph or directed the same edge twice is called the Euler circuit.
subset to a vertex in the network.
other subset.

A-D-F-G-D-B-E-G-H-E-C-B-A
A Tree graph - an Equivalent graphs - two
undirected graph in or more graphs are - If starts with B:
which any two vertices equivalent if the edges
are connected by form the same B-A-D-F-G-D-B-E-G-H-E-C-B
exactly one path, or connections of vertices.
equivalently a connected - Are these graphs DEGREE OF A VERTEX
acyclic undirected graph. below equivalent
- The number of edges that meet at a vertex is
graphs?
called the degree of a vertex.

Euler’s Circuit
- Any graph that has an even degree at every
vertex must have an Euler’s circuit.
- A graph that has an Euler’s circuit is called
Eulerian.
Equivalent graphs
- Are the two graphs equivalent?

Despite the fact that the two graphs have


different arrangements of vertices and edges, they are Eulerian graph theorem
equivalent. The edges are AC, AE, BD, BE, CE, and DE. - A connected graph is Eulerian if and only if
If we do the same for the second graph, we get the every vertex of the graph is of even degree.
same six edges. Because the two graphs represent the
same connections among the vertices, they are
equivalent.

WHAT IS A PATH?
- A path in a graph can be
thought of as a movement from
one vertex to another by
traversing edges. We can refer
to our movement by vertex
letters. For example, in the
APPLICATION OF EULER PATH THEOREM

APPLICATION OF EULER CIRCUIT - THE KONIGSBERG


PROBLEM
- To solve the Konigsberg bridges problem, we
can represent the arrangement of land areas
and bridges with a graph. Let each land area
be represented by a vertex, and connect two
vertices if there is a bridge spanning the
corresponding land areas. Then the
geographical configuration shown in Figure 5.3
become the graph shown in Figure 5.4.

APPLYING THE EULERIAN GRAPH THEOREM

EULER PATH THEOREM


- A connected graph contains an Euler path if
and only if the graph has two vertices of odd
degree with all other vertices of even degree.
Furthermore, every Euler path must start at one
of the vertices of odd degree and end at the
other.
Which graph has an Euler and which one has an Euler
circuit?
APPLICATION OF GRAPH - Each edge’s weight represents the cost to travel
along that edge.
- The cost could be distance, length, time, money,
or some other measure. The cost depends on
the underlying problem.

8. 2 WEIGHTED GRAPHS AND HAMILTONIAN


CIRCUITS Example:
Problem.
The table that follows shows the length of
HAMILTONIAN CIRCUIT
cables needed to connect computers to create a
- A Hamiltonian circuit is a path that uses each
network. Find the minimum length of the cable to be
vertex of a graph once.
used.
- A-B-G-C-D-E-F-A is a Hamiltonian circuit.

- A graph that contains a Hamiltonian circuit is


called Hamiltonian.
- There is no known shortcut to find the optimal
Hamiltonian circuit in a graph.

DIRACH’S THEOREM
- Consider a connected graph with at least three
vertices and no multiple edges. Let n be the
number of vertices in the graph. If every vertex
𝑛
has degree of at least 2
, then the graph must
be Hamiltonian.
Is this graph Hamiltonian?

Solution 1:

WEIGHTED GRAPHS
- A weighted graph is a graph in which each
edge is associated with a value called weight.
THE GREEDY ALGORITHM
- Objective: to find the minimum weight provided
1. Choose a vertex to start at, then travel along
all vertices are visited.
the connected edge that has the smallest
weight. (If two or more edges have the same
weight, pick any one)
2. After arriving at the next vertex, travel along
the edge of the smallest weight that connects to
a vertex not yet visited. Continue this process circuit and does not add a third marked edge
until you have visited all vertices. to a single vertex.
3. Return to the starting vertex. 3. Continue this process until you can no longer
mark any edges. Then mark the final edge that
Example: completes the Hamiltonian circuit.
Use the greedy algorithm to find a Hamiltonian
circuit in the weighted graph. Solution:
We first highlight the edge of the smallest
weight, namely BD with weight 2.

Solution:
Begin at A. The weights of the edges from A
are 13, 5, 4, 15, and 8. The smallest is 4. Connect A to
D.

THE EDGE PICKING ALGORITHM


1. Mark the edge of the smallest weight in the
graph. (If two or more edges have the same
weight, pick any one)
2. Mark the edge of the next smallest weight in
the graph, as long as it does not complete a

You might also like