Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

INTRODUCTION TO

GRAPH THEORY

Seven bridges of Knigsberg


Old Knigsberg had seven
bridges
(markedathroughgin the
sketch). The townspeople
wondered if it was possible
to take a walk around the
town in such a way as to
cross each of the seven
bridges exactly once. What
do you think?

Colouring maps
How many colors
do we need to
color a map so that
every pair of
countries with a
border in common
have different

Travelling salesman
Given a map of
several cities and
the roads between
them, is it possible
for a traveling
salesman to visit
(pass through) each
of the cities exactly
once?

Definition of a graph
What

do these three problems have in common?

They

are questions about connectivity. They ask which land


masses are connected by bridges, which countries by borders,
which cities by roads?

We

could reduce each land mass of Knigsberg to a single dot


(which we will call avertexor node), connected by arcs that we
will calledges.

This

type of object (drawn on the right) is called agraph.

The

Knigsberg question is now:

can

we find a path around this graph that uses each edge exactly
once?

More examples of graphs

Adjacency and degree of a vertex


Two

vertices areadjacentif they are connected by an edge.

In

this graphvertex A is adjacent to B, C and D; but not adjacent to


E or F.

Thedegree

of a vertex is the number of edgeendsat that


vertex. In the graph above the vertices A, B, C, and E have degree
3. Vertices D and F have degree 2.

Adjacency and degree of a vertex


Notice

we are counting edge "ends," soa loop(an edge that


connects a vertex to itself) add 2 to the degree.

The one red vertex in this graph has degree eight.

Adjacency matrix
Anadjacency

matrixis a means of representing whichverticesof


agraphareadjacentto which other vertices. It is a table which
shows the number of edges joining each pair of vertices.

Example

In

a simple graph no vertex is joined to itself (no loops) and there


are no multiple edges between vertices.

Non-simple graphs
Example

The

2
Vertices

convention used here is to use 1 for a loop. However, the loop


contributes 2 for the degree of the vertex.

Edges, paths, circuits


Apathis

a connected sequence of edges (connecting vertices) in


a graph and the length of the path is the number of edges
traversed.

Acircuitis

a path which ends at the vertex it begins, so a loop is a


circuit of length one.

Connected graphs
a

graph isconnectedif there is a path connecting every pair of


vertices.

The

graph above is made of five separatecomponents(five


separate connected subgraphs: four vertices and one vertex with
four loops).

Connectivity Quiz 1
How

many component does this graph have?

Connectivity Quiz 2
Is

this graph connected?

Planar graphs
A

graph isplanarifit can be drawn(on a plane) so that the edges


intersect only at the vertices.

It

is planar if it is possible to draw it on a plane without edges


crossing.

Consider

the first five complete graphs:

complete graphis a simple undirectedgraphin which every


pair of distinct vertices is connected by a unique edge.

Connectivity Quiz 3
The

first three are obviously planar, as is the fourth since itcan be


drawnwithout the 'diagonals' intersecting:

But

what about the fifth? Can it be drawn on the plane without


intersecting edges?

Connectivity Quiz 4
Three

houses must be connected to three utilities (water, gas and


electricity). Can this be done in such a way that the lines do not
cross?

You might also like