0% found this document useful (0 votes)
7 views6 pages

C4 Elem - Graph Theory

Uploaded by

williamlelexing
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)
7 views6 pages

C4 Elem - Graph Theory

Uploaded by

williamlelexing
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/ 6

Graph Theory

This topic is one of the most applicable to real-life applications because all networks
(computer, transportation, communication, organizational, etc.) can be represented
with a graph. For example, a school building has rooms connected by hallways, an
airline map has cities connected by routes, and a rumor network has friends connected
by conversations. Graphs can be used to model such situations.

Defining a Graph

A graph is a collection of vertices and edges. An edge is a connection between two


vertices (or nodes). One can draw a graph by marking points for the vertices and
drawing segments connecting them for the edges, but it must be borne in mind that the
graph is defined independently of the representation.

The precise way to represent a graph is to say that it consists of the set of vertices {A,
B, C, D} and the set of edges between these vertices {AB, AC, BC, AD, DB}. This
graph can be represented in many different ways, two of which are as follows:

​​ ​
These are called undirected graphs because there are no arrows on the lines. An
edge DB is the same as edge BD. Only undirected graphs will be considered in this
topic for the Elementary Division.

One special kind of undirected graph is a complete graph which means that there is
one edge from every vertex to each of the other vertices. These graphs are the same
as drawing a polygon of any number of sides and drawing all of its diagonals. In every
complete graph, the following relationship exists E(dges) = V(ertices) + D(iagonals). In
a pentagon as shown below, there are 5 vertices and 5 diagonals for a total of 10
edges. In a decagon, there are 10 vertices, 35 diagonals, and 45 edges.

​ ​ ​ ​ ​
Different Kinds of Paths

A path between two vertices in a graph is a list of vertices, in which successive vertices
are connected by edges in the graph. For example, BD is a path of length 1 while BAD
is a path of length 2 from vertex B to vertex D. A simple path is a path with no vertex
repeated. For example, BACBD is a path of length 4, but it is not a simple path. BD
and BAD are both simple paths.

A graph is connected if there is a path from every vertex to every other vertex in the
graph. Intuitively, if the vertices were physical objects and the edges were strings
connecting them, a connected graph would stay in one piece if picked up by any
vertex. The above graph is connected, but if edges BC and AC were missing, then
there would be 2 unconnected graphs, one with just vertex C and the other with
vertices {A, B, D} with the remaining 3 edges.

A cycle is a path, which is simple except that the first and last vertex are the same (a
path from a point back to itself). For example, the path ABDA is a cycle in our
example. Vertices must be listed in the order that they are traveled to make the path,
but any of the vertices may be listed first. Thus, ABDA and BDAB are different ways to
identify the same cycle. For clarity, we list the start/end vertex twice, once at the start
of the cycle and once at the end. In an undirected graph, cycles are always 3 or more
vertices. In other words, a single edge of the graph cannot be a cycle such as ABA. In
addition, there are always an even number of cycles in an undirected graph. In the first
graph shown above, ABDA, ADBA, ABCA, ACBA, ACBDA, and ADBCA are all cycles
so there are 6 of them. One of the most difficult problems for computers to solve is
called the Traveling Salesman Problem which tries to find the best route for a
salesperson to take if he/she wants to reach every stop (or vertex) once and only once
while starting and ending at the same place. This isn’t hard to do by hand with a
limited number of vertices, but no algorithm has been developed to find a general
solution to this problem without using some form of artificial intelligence.

Traversable Graphs

Traversability of a graph refers to whether or not you can use every edge once and
only once without lifting your pencil. The most famous traversability example is
the Seven Bridges of Königsberg, a historically notable problem in mathematics.
Wikipedia states, “The city of Königsberg in Prussia was set on both sides of
the Pregel River, and included two large islands which were connected to each other
and the mainland by seven bridges. The problem was to devise a walk through the city
that would cross each bridge once and only once, with the provisos that: the islands
could only be reached by the bridges and every bridge once accessed must be
crossed to its other end. The starting and ending points of the walk need not be the
same.” A graph can be used to model the city as follows:

In 1735 Leonard Euler solved the problem by identifying each vertex as having a
degree which represented the number of edges that came into that vertex. Therefore,
vertex A has degree 3, vertex B has degree 3, vertex C has degree 5, and vertex D
has degree 3. Euler discovered that the number of vertices of odd degree must be
either 0 or 2 for a graph to be traversable.

A path that visits each edge once is called an Euler path. Therefore, the graph
representing the bridges of Königsberg is not traversable since there is no Euler path.
If there are 0 odd vertices, the Euler path can start with any vertex, but if there are 2
odd vertices, one must be the starting point and one must be the ending point.

References

Math for eight-year-olds: graph theory for kids!


Geogebra - Graph Theory for Kids
Kiddle - Graph Theory Facts
Activity: The Seven Bridges of Königsberg
Sample Problems

Draw a complete graph with 5 vertices by


using V = {A, B, C, D, E}.

Find the number of different cycles The graph is as follows:


contained in the graph with vertices
{A,B,C,D} and edges {AB, BC, AC, AD,
DB}.

By inspection, the cycles are ABDA,


ADBA, ACBA, ABCA, ADBCA, and
ACBDA. Thus, there are 6 cycles in the
graph.

In the above graph, list all simple paths of The paths are CADB, CABD, CBAD, and
length 3 starting from vertex C. CBDA. You cannot go to vertex D first.

Given the following graph, write the The set of vertices is {a,b,c,d,e} and the
precise definition by listing the set of set of edges is {ab,ad,bc,cd,ae}.
vertices and the set of edges.
Edges can be written in either order since
it is an undirected graph.
Using the above graph, identify all of the All of the simple paths from vertex ‘b’ to
simple paths from vertex b to vertex d. vertex ‘d’ are ‘bad’ and ‘bcd’.

Using the above graph, how many paths There are 12 paths of length 2 including
of length 2 are there? ‘abc’, ‘adc’, ‘bae’, ‘bad’, ‘bcd’, ‘cba’, ‘cda’,
‘dae’, ‘dcb’, ‘dab’, ‘eab’, and ‘ead’.

Using the above graph, if the graph is This graph is traversable starting with
traversable, identify its possible starting vertex ‘a’ and ending with vertex ‘e’ or
and ending vertices. If it is not, write NO. starting with ‘e’ and ending with ‘a’.

Using the above graph, identify all cycles. The only cycles are ‘abcda’ and ‘adcba’.
Letters must be in that order but it can
start and end with any of the letters. In
undirected graphs, there are no cycles
between just 2 vertices.

How many edges are there in a complete A complete graph with 6 vertices is a
graph with 6 vertices? hexagon with all of its diagonals. There
are 9 diagonals and 6 sides so that
makes 15 edges. This is also the
number of handshakes that 6 people
must make for everyone to shake each
other person’s hand once and only once.
Which of the following graphs is NOT By inspection, the following table shows
traversable? the number of vertices and the degree of
each. Vertices are listed from the top of
each graph to the bottom and left to right.

V A B C D E F Y/N
1 4 2 2 2 2 Y
2 4 3 2 2 3 Y
3 4 3 3 3 3 N
4 5 3 3 4 3 3 N
5 4 4 4 3 3 Y
6 5 4 4 4 3 3 Y
7 5 2 4 4 3 3 Y
8 6 2 4 4 4 3 3 Y

For example, an Euler path in graph 1 is


ABCDA and an Euler path for graph 2 is
ABDACD. An Euler path in graph 5 must
start with either C or D and end with the
other one and an Euler path for graph 8
must start and end with vertices E and F
which could be EDBACBEFDCF or
FDCFEDBACBE. The answer is 3 & 4.

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