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

Notes Graph

The document defines basic graph theory terms including undirected and directed graphs, vertices, edges, degrees, subgraphs, paths, cycles, trees, and graph representations using adjacency and incidence matrices. It provides definitions, examples, theorems, and proofs related to graph order, size, connectivity, traversability, and strong components.

Uploaded by

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

Notes Graph

The document defines basic graph theory terms including undirected and directed graphs, vertices, edges, degrees, subgraphs, paths, cycles, trees, and graph representations using adjacency and incidence matrices. It provides definitions, examples, theorems, and proofs related to graph order, size, connectivity, traversability, and strong components.

Uploaded by

Furkan memon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1 Basic Definitions of Graph Theory.

Definition 1
An undirected graph G = (V, E) consists of a set V of elements called vertices, and a
multiset E (repetition of elements is allowed) of pairs of vertices called edges.

The order of a graph G(V, E) is |V |; the size of G(V, E) is |E|. A graph of order p and
size q is called a (p, q)-graph.

If e = (v, u) is an edge in G, then e joins u and v; e is incident with u and v; u


and v are endpoints of e; u and v are incident with e; u and v are adjacent to each
other. The degree of a vertex v, denoted degG (v), or deg(v), is the number of edges of
the form vw, for some w.

A subgraph of a graph G = (V, E) is a graph H(U, F ) such that U ⊆ V and F ⊆ E;


G is a supergraph for H. H is an induced subgraph of G if all edges of G connecting
vertices in H belong to H. H is a spanning subgraph of G if V (H) = V (G). If G is
a graph and S ⊆ V (G) then G − S denotes the subgraph of G induced on V (G) − S. If
R ⊆ E(G), then G − R denotes graph (V (G), E(G) − R).

A walk from a vertex v to a vertex u is a sequence W of alternating vertices and edges

v1 , e1 , v2 , e2 , . . . , ek−1, vk ,

such that v1 = v, vk = u and ∀i = 1, . . . , k − 1, ei is incident with vi and vi+1 ; k − 1 is


called the length of W . A walk without repeated edges is called a trail. A walk (trail)
with v1 = vk is called closed. If all vertices in W are distinct, W is called a path. If all
vertices in a closed walk W are distinct and k ≥ 3, then W is called a cycle. A graph
is called connected if any two vertices u and v are connected by a walk. A subgraph H
of G is called a connected component if H is a maximal (non-extensible) connected
subgraph of G. The number of connected components of a graph G is (often) denoted
k(G).

A distance dist(v, u) between two vertices u and v of a connected graph is the length of
the shortest path connecting them. For a connected graph G.

E(v) = maxx∈V (G) dist(v, x) the eccentricity of v in G;


D(G) = maxv E(v) the diameter of a G;
R(G) = minv E(v) the radius of G .

A graph is called a tree, if it is connected and has no cycles. A leaf is a vertex of degree
1. A rooted tree is a tree with a distinguished vertex, called root. A level of a vertex

1
in a rooted tree is the distance from the vertex to the root. If a vertex v lies on the path
from the root to a vertex u, then v is called an ancestor of u; if additionally, u and v are
adjacent then u is a child of v and v is a parent of u. An ordered tree is a rooted tree
in which the children of every vertex are assigned a fixed ordering. A binary tree is an
ordered tree in which every vertex has at most two children, one of which is called the
left child and the other is called the right child.

Theorem 1 Every tree has at least two leaves.

Proof. Consider a longest path P in a given tree T (note that there can be more than
one longest path). Let u and v be the endpoints of P . Then each of these two vertices is
a leaf, since otherwise either, T has a cycle, or P is not a longest path.

Theorem 2 A tree with p vertices has q = p − 1 edges.

Proof. We prove the statement by induction on p.

BASE. For p = 1, every graph T has 0 = p − 1 edges.

INDUCTIVE STEP. Let the statement hold for some p ≥ 0 and let T be a tree with
p + 1 vertices. Then by Theorem 1, T has a leaf x. T − x must be a tree, since if x were
on a path connecting some two vertices then x would be of degree ≥ 2. In the tree T − x,
there are p − 1 vertices and p − 2 edges (by induction.) We finish the proof noticing that
removing x, removes exactly one edge.

2 Digraphs: Basic Definitions

A directed graph, or digraph G = (V, E) consists of V : a non-empty set of elements


called vertices, or nodes, and E: a set of pairs of ordered vertices called edges, or arcs.

Example: V = {a, b, c, d}; E = {(a, b)(a, c)(d, b)}

a b c d

The order (size) of a graph G(V, E) is the number of vertices (edges) or vertex number
(edge number), written |V | (|E|). A graph of order p and size q is called a (p, q)-graph.

If e = (v, u) is an edge in G, then


2
v and u are the end-vertices of e;
v (resp. u) is the tail (resp. the head) of e;
e leaves v and enters u;
e is incident with v and u;
u and v are incident with e;
u and v are adjacent to each other.

For a digraph G parallel arcs (same tail and same head) are not allowed; loops (an arc
whose tail coincides with the head) are not allowed either. If parallel edges and/or loops
are allowed, the object is called directed pseudo-graph.

For a digraph G:
N + (v) = {u : (v, u) ∈ E(G)}; out-neighborhood;
N − (v) = {u : (u, v) ∈ E(G)}; in-neighborhood;
N + (v) ∪ N − (v) = {u : (u, v) ∈ E(G) or (v, u) ∈ E(G)}; neighborhood;
If A ⊆ V (G), then N + (A) = x∈A N + (x) − A.
S

N − (A) = x∈A N − (x) − A.


S

deg + (v) = |N + (v)| is the out-degree of v;


deg − (v) = |N − (v)| is the in-degree of v;
deg(v) = deg + (v) + deg − (v) is the degree of v;
δ + (G) = min{deg + (v)}; ∆+ (G) = max{deg + (v)};
δ − (G) = min{deg − (v)}; ∆− (G) = max{deg − (v)};
A graph is called regular if

min{δ + (G), δ − (G)} = max{∆+ (G), ∆− (G)}.

Theorem 3
deg + (x) = |E(G)|.
X X
deg − (x) =
x∈V (G) x∈V (G)

A digraph H is a subgraph, or subdigraph of G, if V (H) ⊆ V (G) and E(H) ⊆ E(G).


G is called a supergraph, or superdigraph for H.

H is a spanning subgraph of G, if V (H) = V (G). H is an induced subgraph of G, if


every edge (v, u) ∈ E(G) for which u, v ∈ V (H), is also an edge in H.

Reversing the edge (u, v) is replacing the edge with (v, u). The converse of G is a
digraph obtained from G by reversing all edges.

3
Contraction of a subgraph H in a graph G is the replacement of V (H) with a new
vertex z and creating new edges (x, z) (resp. (z, y)) iff there is any edge (x, t) (resp.
(s, y)), where t ∈ V (H) (resp. s ∈ V (H)).

The underlying graph of G = (V, E) is an undirected graph K = (V, E ′ ), where (x, y) ∈


E ′ iff either (x, y) ∈ E, or (y, x) ∈ E.

A walk of a graph G = (V, E) is a an alternating sequence

W = x1 a1 x2 · · · xk−1 ak−1 xk ,

where ∀i, xi ∈ V (G) and (xi , xi+1 ) ∈ E(G).

A trail is a walk in which all edges are distinct. A path is a trail in which all vertices
are distinct. A cycle is a closed walk in which all vertices are distinct, except the last
and the first.

A vertex x is reachable from y, if G has an (y, x)-walk. The digraph is strongly


connected, or strong, if every vertex is reachable from any other vertex. A digraph is
called weakly-connected, if its underlying graph is connected.

Proposition 1 If digraph G has an x, y-walk, then it has an x, y-path.

A digraph G is called acyclic, or a DAG, if it has no cycle. An ordering x1 , x2 , . . . , xn of


G is called acyclic, if no edge (xi , xj ) exists in G with i > j.

Proposition 2 Every acyclic digraph G has an acyclic ordering x1 , x2 , . . . , xn ; the in-


degree of x1 is zero and the out-degree of xn is zero.

Proposition 3 If G is an acyclic graph with exactly one vertex x of in-degree zero, and
exactly one vertex y of out-degree zero, then for every v ∈ V (G), there is an (x, v)-path
and (v, y)-path.

A maximal strong subgraph of a given digraph G is called a strongly connected com-


ponent, or a strong component of G.

4
4 6
5

Proposition 4 Let G be a digraph and let H1 , H2 be two distinct strong components of


G. Then, V (H1 ) and V (H2 ) are disjoint sets. If x ∈ V (H2 ) is reachable from y ∈ V (H1 ),
then no vertex from H1 is reachable from any vertex in H2 .

Let H1 , H2 , . . . , Hk be the set of all strong components of a digraph G. A new digraph


F = SC(G) is defined whose vertices are z1 , z2 , . . . , zk and (zi , zj ) ∈ E(F ) iff G has an
edge from Hi to Hj .

Proposition 5 For every digraph G, SC(G) is an acyclic digraph.

A strong component of a graph G which corresponds to a vertex x in SC(G) of in-degree


zero, is called an initial strong component.

5
3 Graph representation

Adjacency matrix:

a1,1 a1,2 . . . a1,n


 
(
 a a . . . a2,n  1, if vi and vj are adjacent,
A =  2,1 2,1 ; ai,j =
 
 ... ...  0, otherwise.
an,1 an,2 . . . an,n

Incidence matrix:

b1,1 b1,2 . . . b1,q


 
(
 b b . . . b2,q  1, if vertex vi incident with edge ej ,
A =  2,1 2,1 ; ai,j =
 
 ... ...  0, otherwise.
bp,1 bp,2 . . . bp,q

Adjacency list:

1 2 3 4 5 6
2 1 1 1 4 6

3 3 2 5

4 6

4 Distances in digraphs

The distance dist(x, y) from x to y is the length of the shortest (x, y)-path.

Define
dist(X, Y ) = max dist(x, y);
x∈X;y∈Y

6
rad+ (G) = min dist(v, V (G));
v

rad (G) = min dist(V (G), v);
v

diam(G) = max max dist(v, x);


v u

dist(v, V ) + dist(V, x)
rad(G) = min .
v 2

Theorem 4 Let A be the adjacency matrix of a digraph G with n vertices and let Ak be
the k-th power of A. Then for every i, j ∈ [0, n − 1], the entry aki,j of Ak is the number of
walks of length k from vi to vj .

Proof. Induction on k.

7
5 Set-Theory.

Definition 2 Given two sets A and B, a function f : A → B is called one-to-one, if

∀x, y ∈ A, x 6= y, f (x) 6= f (y).

Definition 3 Given two sets A and B, a function f : A → B is called unto, if

∀y ∈ B, ∃x ∈ A, f (x) = y.

Definition 4 Two sets A and B are called of the same size, or of the same cardi-
nality, if there exists a one-to-one, onto function f : A → B.

one-to-one

onto

same cardinality

Proposition 6
Let N be the set of all non-negative integers, and let Ne be the set of all even non-negative
integers. Then N and Ne are of the same cardinality.

Proof. Consider function f : N → Ne defined by

f (i) = 2i, i ∈ A.

Definition 5 If a set A is of the same cardinality as N , it is called countable; otherwise,


the set is called uncountable.

8
Theorem 5 Let Q be the set of positive rational numbers. Then Q is countable.

Proof. We consider a set Q′ , comprised of all rationals p/q, where p, q = 1, 2, 3, . . ..


Clearly, every positive rational number r is repeated in Q′ an infinite number of times.
We prove that even Q′ is countable. The correspondence f is defined by the formula
p (p + q − 1)(p + q − 2)
f( ) = +p
q 2
and is illustrated in the figure below.

1 1 1 1 1 1 2 4 7 11
1 2 3 4 5
2 2 2 2 2 5
1 2 3 4 5 3 8 12
3 3 3 3 3 6
1 2 3 4 5 9 13
4 4 4 4 4
1 2 3 4 5 10 14
5 5 5 5 5
1 2 3 4 5 15

Theorem 6 Let SUBf be the set of all finite subsets of N . Then SUBf is countable.

Theorem 7 The set R of all infinite 0,1-sequences is not countable.

Proof. Suppose that contrary to the claim, R is countable and let f : N → R be a


one-to-one correspondence between these sets. Denote fi (k) to be the ith entry of the
sequence f (k) (i, k > 0). Now, consider the sequence

s = {1 − f1 (1), 1 − f2 (2), 1 − f3 (3), . . . , 1 − fk (k), . . .}.

By construction, the kth entry of s is different from fk (k), thus s is different from every
f (k) (k = 1, 2, . . . .) This proves that f is not a mapping onto; consequently, R is not
countable.

Remark 1 The argument used for the proof of the previous theorem is called the diagonalization
argument.

You might also like