Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

Bridges of Königsberg

The city of Königsberg had two river islands in the river Pregel and there were
seven bridges connecting the banks and islands as follows.
Bridges of Königsberg

The city of Königsberg had two river islands in the river Pregel and there were
seven bridges connecting the banks and islands as follows.

Is it possible to start from any place, go through each bridge exactly once and
return to the same place?
Leonard Euler: Only relevant piece of information is the existence and number of
bridges connecting two places.
Leonard Euler: Only relevant piece of information is the existence and number of
bridges connecting two places.

Such a walk possible iff we can draw the diagram without lifting pencil.

A diagram such as above is called a graph . The dots are called vertices and the
lines are called the edges of the graph.
Graph
A graph aka an undirected graph G is an ordered pair (V, E) consisting of a set
V = V ( G ) of vertices and a set E = E( G ), disjoint from V, of edges, together with
an incidence function ψG that associates with each edge of G an unordered pair of
(not necessarily distinct) vertices of G. If e is an edge and u and v are vertices such
that ψG (e) = {u, v}, then e is said to join u and v, and the vertices u and v are
called the endpoints of e.

Example
Let V = {1, 2, 3, 4, 5}, E = {{1, 3}, {1, 5}, {2, 4}, {3, 5}, {1, 4}}.

We denote the numbers of vertices and edges in G by | G | and ||( G )||; these two
basic parameters are called the order and size of G, respectively.
For the sake of brevity, we often represent the edge {u, v} by writing uv.

Example
Let G = (V, E) be given by: V = {u, v, w, x, y}, E = { a, b, c, d, e, f , g, h}. Where the
incidence function is given by ψG ( a) = uv, ψG (b) = uv, ψG (c) = uu, ψG (d) =
ux, ψG (e) = vx, ψG ( f ) = wy, ψG ( g) = uw, ψG (h) = uy
Graphical representation

We usually think of a graph by identifying the vertices with distinct points on a


surface (like the plane) and edges are represented by simple curves that connect
the points corresponding to the endpoints of the edges.
Two edges are called parallel edges if they both have the same endpoints. If
endpoints of an edge are identical, it is called a loop.
Two edges are called parallel edges if they both have the same endpoints. If
endpoints of an edge are identical, it is called a loop.

Simple graphs
A graph without having parallel edges or loops is called a simple graph.
Two edges are called parallel edges if they both have the same endpoints. If
endpoints of an edge are identical, it is called a loop.

Simple graphs
A graph without having parallel edges or loops is called a simple graph.

Multigraphs
A graph is called a multigraph if it allows parallel edges and loops.
Two edges are called parallel edges if they both have the same endpoints. If
endpoints of an edge are identical, it is called a loop.

Simple graphs
A graph without having parallel edges or loops is called a simple graph.

Multigraphs
A graph is called a multigraph if it allows parallel edges and loops.

A graph without having loops, but allows parallel edges is called a loopless
multigraph.

Note:
Much of graph theory and this course deals with simple graphs. We therefor use
the term graph to denote a simple graph, unless we state otherwise.
Definitions

Adjacency
Definitions

Neighbours
Definitions

Incident
Definitions

Finite graph
Definitions

Infinite graph
Definitions

Degree of a vertex: d(v), deg(v)


Definitions

Maximum degree : ∆( G )
Definitions

Minimum degree : δ( G )
First theorem of graph theorey
Let G be a graph. Then
∑ deg(v) = 2|E|
v ∈V
Special graph families

Complete graph: A simple graph is complete if any two vertices are adjacent.
Special graph families

Independent set: A set S ⊂ V of vertices in a graph G is independent if no two


vertices of S are adjacent.
Special graph families

Bipartite graph: A graph is bipartite if its vertices can be partitioned to two


independent sets.
Special graph families

Path graph: A graph whose vertices can be arranged in a linear sequence so that
two vertices are adjacent if consecutive in the sequence and non-adjacent
otherwise. The length of a path is the number of edges in it. The path graph

v1 , v2 , · · · , vn is denoted Pn . It has length n − 1.


Special graph families

Cycle graph: A cycle is a graph whose vertices can be arranged in a cyclic


sequence where two verties are adjacent if they are consecutive and non-adjacent
otherwise. The length of a cycle is the number of edges in it.
Special graph families

Complement of a graph: Let G be a graph. Define a new graph Ḡ on the vertex set
of G where two vertices are adjacent if and only if they are non-adjacent in G. We
call Ḡ the complement of G.
Walks, Trails, Paths

A u − v walk of length k in a graph G is a sequence of vertices


u = v0 , v1 , v2 , · · · , vk = v such that vi vi+i ∈ E for 0 ≤ i < k.

Example

When u = v, the walk is said to be a closed walk.


Walks, Trails, Paths

A trail in a graph G is a walk where no edges are repeated.

Example

When u = v, the trail is said to be a closed trail.


Walks, Trails, Paths

A path in a graph G is a walk such that no vertex is repeated.

Example
A vertex u is connected to a vertex v if there is a u − v walk in G. We say that vertex
v is reachable from u. Observer that this relation is symmetric for undirected
graphs.
A vertex u is connected to a vertex v if there is a u − v walk in G. We say that vertex
v is reachable from u. Observer that this relation is symmetric for undirected
graphs.

A graph G is connected if every pair u, v of vertices in G, there is a u − v walk in G.


A vertex u is connected to a vertex v if there is a u − v walk in G. We say that vertex
v is reachable from u. Observer that this relation is symmetric for undirected
graphs.

A graph G is connected if every pair u, v of vertices in G, there is a u − v walk in G.

A graph is connected if and only if there is a u − v path for every pair (u, v) of
vertices.
Reachability over a graph G is an equivalence relation and the equivalence classes
are called connected components (or simply components) of the graph G.
Eulerian Tour
A closed trail in a graph G is said to be an Eulerian tour of G if it covers all the
edges of G.
Eulerian Tour
A closed trail in a graph G is said to be an Eulerian tour of G if it covers all the
edges of G.
When does a graph admit Eulerian tour? Note that solution to this also solves the
Konigsberg bridge problem.
Theorem
A graph G admits an Eulerian tour if and only if it has at most one non-trivial component
and every vertex of G has even degree.
Proof:
Hamiltonian paths. Difficulty.
Isomorphism:
Two graphs G, H are isomorphic if there is a bijection φ : V ( G ) → V ( H ) such that
uv ∈ E( G ) if and only if φ(u)φ(v) ∈ E( H ).

Homework:
Show that graph isomorphism is an equivalence relation.

Isomorphic graphs have same structural properties. Thus we often study


unlabelled graphs - representatives of isomorphism classes.
Theorem
If a graph G has a closed walk of odd length, then G contains an odd cycle.
A graph H is a subgraph of a graph G if V ( H ) ⊆ V ( G ) and E( H ) ⊆ E( G ).
Directed graphs, Walks, Paths, Cycles, Acyclic Digraphs, Tournaments, Directed
Eulerian graphs. Hamiltonian paths.
Modelling with graphs

Does every set of 6 random persons contain three mutual acquaintences or three
mutual strangers?

Acquainteces and Strangers


Since acquaintance is a symmetric binary relation, we model the problem using a
simple graph where persons correspond to vertices and two vertices are adjacent
if the corresponding persons are acqaintances. The stranger relation provides the
complementary set of edges (or non-edges in this graph).
Now the problem translates to asking if every 6 vertex graph contains either a
3-clique or an independent set of size 3.
Routes in Road Networks.

We model road intersections and terminals as vertices and roads between two
points by edges. One can assign weights to the edges to represent the length of the
road.
Is there a route from x to y.
What is the shortest route between x to y?
What is the shortest distance from x to y.
Job assignments
We have m jobs and n people. Not all are qualified for all jobs. We need see if we
can fill each job with a qualified person.
We model this using a simple graph with vertices for each job and people. Job j is
adjacent to person p in this graph if person p is qualified for the job j.
Such a graph is clearly bipartite. The question translates to finding a set of m
pairwise disjoint edges.
Scheduling

The department has several committees who needs to schedule meetings to


designated time slots on the second saturday of every month. Two committees
having a common member cannot have the meeting at the same slot. How many
different time slots need to be fixed?
Graph Colouring
Represent the commitees as vertices of a graph G and two edges in G are adjaent if
the corresponding committees have a common member. The questiong translates
to assigning colours to vertices of G so that adjacent vertices do not get the same
colour using the minimum possible number of colours.
Several other problems like the famous map colouring problem, time table
management, examination scheduling, solving sudoku puzzles, register allocation
in computers, mobile tower frequency assignment etc. can all be framed in terms
of graph colouring.
Forest
A graph is acyclic if it has no subgraph that is isomorphic to a cycle. An acyclic
graph is called a forest. A leaf is a vertex of degree 1.
Connected components of forests are called trees. Thus, a tree is a connected
acyclic graph.
Theorem
Let T = (V, E) be a graph. Then the following are equivalent.
1 T is minimally connected. That is, T is connected, but for any edge uv in T, the
graph T − uv is not connected.
2 T is maximally acyclic. That is, T is acyclic, but for any pair of non-adjacent vertices
u, v in T, the graph T + uv contains a cycle.
3 T is a connected graph of order n with n − 1 edges.
4 T is acyclic graph of order n with size n − 1.
5 There is a unique path between any two vertices of T.
6 T is a tree.
A subgraph H of a graph G is said to be a spanning subgraph if V ( H ) = V ( G ). A
tree that is a spanning subgraph of G is a spanning tree of G.
Theorem
Every tree of order at least 2 contains at least two leaves. Deleting a leaf from a tree with n
vertices produces a tree with n − 1 vertices.
Consider a graph that represent a telephone network, cable network or road
network. The distance between nodes is often proportional to the cost of laying
out the network connections.

You might also like