Professional Documents
Culture Documents
Black
Black
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
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
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
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
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
Example
Example
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 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.
Does every set of 6 random persons contain three mutual acquaintences or three
mutual strangers?
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