0% found this document useful (0 votes)
56 views11 pages

GraphTheory II

1) A graph can be represented by an adjacency matrix and incidence matrix that describe the connections between vertices and edges. 2) A tree is a connected acyclic graph where every edge is a bridge. The number of edges in a tree of order n is n-1. 3) There are several methods for constructing a spanning tree within a connected graph that uses the same vertices but removes cycles.
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)
56 views11 pages

GraphTheory II

1) A graph can be represented by an adjacency matrix and incidence matrix that describe the connections between vertices and edges. 2) A tree is a connected acyclic graph where every edge is a bridge. The number of edges in a tree of order n is n-1. 3) There are several methods for constructing a spanning tree within a connected graph that uses the same vertices but removes cycles.
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/ 11

GRAPH THEORY II

A graph G can be dened by two sets, namely its vertex set V (G) and edge set E(G) or by a diagram. A
graph can also be described by a matrix and for some purposes this is especially useful.

Let G be a graph of order n and size m, where V (G) = {v1 , v2 , ..., vn } and E(G) = {e1 , e2 , ..., em }.

The adjacency matrix of G is the n × n matrix A = [aij ], where

1 if vi vj ∈ E(G)
(
aij =
0 otherwise
while the incidence matrix of G is the n × m matrix B = [bij ] , where

1 if vi is incident with ej
(
bij =
0 otherwise

For the graph

the adjacency matrix and the incidence matrix are given as below.
   
0 1 1 1 0 1 1 1 0 0 0
1 0 0 1 0 1 0 0 1 0 0
   
1
A= 0 0 1 0 0
B= 1 0 0 1 0
1 1 1 0 1 0 0 1 1 1 1
0 0 0 1 0 0 0 0 0 0 1

1
A graph G is called acyclic if it has no cycles. A tree is an acyclic connected graph.

Therefore, the graph G of the above gure is a tree.


When dealing with trees, we often use T rather than G to denote a tree.

Theorem: Every edge in a tree is a bridge.


Indeed, we could dene a tree as a connected graph, every edge of which is a bridge.

The below gure shows all six trees of order 6.

The tree T1 = K1,5 is a star and T6 = P6 is a path. The number of end-vertices in the trees of the above
gure ranges from 2 to 5. A tree containing exactly two vertices that are not end vertices(which are necessarily
adjacent) is called a double star. The trees T2 and T3 in the above gure are double stars.
A caterpillar is a tree of order 3 or more, the removal of whose end-vertices produces a path called the spine
of the caterpillar. Thus every path and star (of order at least 3) and every double star is a caterpillar, as is
every tree shown in the above gure.
The trees T 0 and T 00 of the below gure are also caterpillars but T 000 is not.

Sometimes it is convenient to select a vertex of a tree T under discussion and designate this vertex as the root
of T . The tree T then becomes a rooted tree. Often the rooted tree T is drawn with the root r at the top
and the other vertices of T drawn below, in levels, according to their distances from r. An example is given in
the below gure.

Acyclic graphs are also referred to as forests. Therefore, each component of a forest is a tree. One fact that
distinguishes trees from forests is that a tree is required to be connected, while a forest is not required to be
connected. Since a tree is connected, every two vertices in a tree are connected by a path.

Theorem: A graph G is a tree if and only if every two vertices of G are connected by a unique path.
Proof: First, let G be a tree. Then G is connected by denition. Thus every two vertices of G are connected
by a path. Assume, to the contrary, that there are two vertices of G that are connected by two distinct paths.
Then a cycle is produced from some or all of the edges of these two paths. This is a contradiction.
For the converse, suppose that every two distinct vertices of G are connected by a unique path. Certainly
then, G is connected. Assume, to the contrary, that G has a cycle C . Let u and v be two distinct vertices
of C . Then C determines two distinct u−v paths, producing a contradiction. Thus G is acyclic and so G is a tree.

2
Theorem: Every nontrivial tree has at least two end-vertices.
Proof: Let T be a nontrivial tree and among all paths in T , let P be a path of greatest length. Suppose
that P is a u − v path, say P = (u = u0 , u1 , ..., uk = v), where k ≥ 1. Observe that neither u nor v is adjacent
to any vertex not on P , for otherwise, a path of greater length would be produced. Certainly, u is adjacent to
u1 on P and v is adjacent to uk−1 on P . Moreover, since T contains no cycles, neither u nor v is adjacent to
any other vertices in P . Therefore, deg u = deg v = 1.

Theorem: Every tree of order n has size n − 1.


Proof: There is only one tree of order 1, namely K1 , which has size 0. Thus the result is true for n = 1.
Assume for a positive integer k that the size of every tree of order k is k − 1. Let T be a tree of order k + 1.
Every nontrivial tree T contains at least two end vertices. Let v be one of them. Then T 0 = T − v is a tree of
order k. By the induction hypothesis, the size of T 0 is m = k − 1. Since T has exactly one more edge than T 0 ,
the size of T is m + 1 = (k − 1) + 1 = (k + 1) − 1, as desired.

Problem: The degrees of the vertices of a certain tree T of order 13 are 1, 2 and 5. If T has exactly three
vertices of degree 2, how many end-vertices does it have?
Ans: x × 1 + 3 × 2 + (10 − x) × 5 = 2 × (13 − 1) =⇒ x = 8
Hence the tree 8 end vertices.

Corollary: Every forest of order n with k components has size n − k.


Proof: Suppose that the size of a forest F is m. Let G1 , G2 , ..., Gk be the components of F , where
P k ≥ 1.
Furthermore, suppose that Gi has order ni and size mi for 1 ≤ i ≤ k. Then n = ki=i ni and m = ki=i mi .
P
Since each component Gi (1 ≤ i ≤ k) is a tree, and every tree of order n has size n − 1 it follows that mi = ni − 1.
Therefore, m = ki=i mi = ki=i (ni − 1) = n − k.
P P

For a vertex v in a connected graph G, the eccentricity e(v) of v is the distance between v and a vertex
farthest from v in G. The center of G is a vertex having minimum eccentricity.
Considering the eccentricity of the vertices of a tree, it is evident that the vertices having the largest eccen-
tricities are among the leaves, since each path of maximal length connects two leaves. In particular, a leaf is
never a center of a tree on three or more vertices, and centers must therefore be among the internal vertices. In
the below gure, we see that the center must be among the vertices labeled a, b, c, d, e, f or g . By removing all
the leaves from the original tree, the eccentricity of each internal vertex of a tree will be reduced by one, and
hence the center of the original tree is the vertex of the pruned tree with minimum eccentricity. Again in the
below gure we see that the center of the original tree must therefore be among the non leaves of the pruned
tree, namely among c, d or e. This process can be continued until we are left with either a single vertex or two
adjacent vertices. In the below gure we are indeed left with a single vertex c, which is therefore the unique
center of this tree.

Theorem: There are one or more centers in every tree; in the later case they are adjacent.
Theorem: Let T be a tree on more than one vertex.
(i) If a longest path of T has an even length, then T has exactly one center, which is the mid-vertex of each
longest path.
(ii) If a longest path of T has an odd length, then T has exactly two adjacent centers, which are the two mid
most vertices of each longest path.

Let T be a tree and r ∈ V (T ). A rooted tree is the ordered pair (T, r). The vertex r is called the root of T .

3
If a connected graph G of order n has no cycles, then, of course, G is a tree. On the other hand, suppose
that G contains cycles. Let e1 be an edge lying on a cycle of G. Then e1 is not a bridge and G − e1 is connected.
If G − e1 contains cycles, then let e2 be an edge lying on a cycle of G − e2 . Then G − e1 − e2 is connected.
Eventually, we arrive at a set X = {e1 , e2 , ..., ek } of edges of G such that G − X is a tree. The tree G − X just
constructed is a subgraph of G that has the same vertex set as G.

Let G be a connected graph. Consider the empty graph H with vertex set V (G). Add an edge f1 of G to
H . Then add another edge f2 of G to H . Next, add another edge f3 of G to H , where f3 ∈ / {f1 , f2 } and such
that no cycle is produced. We continue this until we have added edges f1 , f2 , ..., fn−1 of G to H , producing a
graph F of order n, size n − 1 and no cycles. Then, F is a tree with V (F ) = V (G). We know it's possible to
construct a tree in this manner as we can always choose the edges of G − X mentioned above.

We have just described two ways of producing trees T that are subgraphs of a given connected graph G such
that V (T ) = V (G). Also it is a spanning subgraph of G.

In the below gure T1 and T2 represent spanning trees of the graph G.

Let G be a connected graph each of whose edges is assigned a number(called the cost or weight of the
edge). We denote the weight of an edge e of G by w(e). Recall that such a graph is called a weighted graph.
For each subgraph H of G, the weight w(H) of H is dened as the sum of the weights of its edges, that is,
w(e).
P
w(H) =
e∈E(H)

We seek a spanning tree of G whose weight is minimum among all spanning trees of G. Such a spanning
tree is called a minimum spanning tree. The problem of nding a minimum spanning tree in a connected
weighted graph is called the Minimum Spanning Tree Problem.

Kruskal's Algorithm: For a connected weighted graph G, a spanning tree T of G is constructed as follows:
For the rst edge e1 of T , we select any edge of G of minimum weight and for the second edge e2 of T , we select
any remaining edge of G of minimum weight. For the third edge e3 of T , we choose any remaining edge of G of
minimum weight that does not produce a cycle with the previously selected edges. We continue in this manner
until a spanning tree is produced.

The below gure shows how a spanning tree of a connected weighted graph is constructed using Kruskal's
Algorithm.

Problem:
Determine all spanning trees for the graphs G and H in the below gure. Which of these spanning trees are
isomorphic?

Problem:
Apply Kruskal's algorithm to nd a minimum spanning tree in the weighted graphs in the below gure. In each
case, show how this tree is constructed.

4
Cayley theorem: The number of spanning trees of Kn is nn˘2 .
Corollary: There are nn˘2 distinct labeled trees on n vertices.
The below gure shows the complete graph K4 and its spanning trees(only the rst two spanning trees are
labeled, the same labeling follows for the remaining spanning trees).

How can we prove that the Cayley's formula is true for all n?
It suces, if we are able to nd a bijection between the set of spanning trees and some other set with a known
number of elements. And that set turns out to be a sequence known as the Prufer's sequence.

A Prufer sequence is a sequence of n − 2 numbers, each being one of the numbers 1 through n. We should
initially note that indeed there are nn−2 Prufer sequences for any given n.
The following is an algorithm that can be used to encode any tree into a Prufer sequence:
1. Take any tree, T ∈ Tn , whose vertices are labeled from 1 to n in any manner.
2. Take the vertex with the smallest label whose degree is equal to 1, delete it from the tree and write down
the value of its only neighbor.
3. Repeat this process with the new, smaller tree. Continue until only one vertex remains.
This algorithm will give us a sequence of n − 1 terms, but we know that the last term will always be the
number n because even if initially d(n) = 1, there will always be another vertex with a smaller label such that
d(that vertex) = 1 . Since we already know the number of vertices on the graph by the length of the sequence,
we can drop the last term as it is redundant. So now we have a sequence of n−2 elements encoded from our tree.

Below is an example encoding a tree on 6 vertices:

After encoding the tree, we end up with the sequence: 5, 1, 1, 5, 6; then we can drop the ending 6 and end
with our Prufer Sequence and denote it by P . i.e., P = 5, 1, 1, 5.

Note: (i) All of the vertices of degree 1 do not occur in P .


(ii) Every vertex has degree equal to 1 + a, where a is the number of times that vertex appears in the sequence.

5
Conversely a Prufer Sequence can be used to reconstruct an encoded tree. The algorithm goes as follows:
1. Find the smallest number from 1 to n that is not in the sequence P and attach the vertex with that number
to the vertex with the rst number in P .(We know that n = 2 + number of elements inP .)
2. Remove the rst number of P from the sequence. Repeat this process considering only the numbers whose
vertices have not yet attained their correct degree.
3. Do this until there are no numbers left in P . Remember to attach the last number in P to vertex n.

We can see that for every tree there is exactly one corresponding Prufer Sequence, and for each Prufer
Sequence there is exactly one corresponding tree. More formally, the encoding function can be thought of as
taking a member of the set of spanning trees on n vertices, Tn , to the set of Prufer Sequences with n − 2 terms,
Pn . Since we have found a bijective function between Tn and Pn , we know that they must have the same number
of elements. We know that |Pn | = nn−2 , and so |Tn | = nn−2 .

Problem:
Find the corresponding Prufer sequence for the below graphs.

(i) (ii) (iii)

Problem:
Find the corresponding tree for the below Prufer sequences.
(i) P = 1, 1, 1, 1, 6, 5 (ii) P = 1, 1, 5 (iii) P = 4, 1, 3, 4

Let T be a spanning tree of a graph G. Then the edges of G that are in T are called branches of G. The
edges of G that are not in T are called chords(or tie or link) of G with respect to T . The set of all chords of
G is called chord set or cotree. An edge between any two vertices of T gives a circuit. Any circuit of G that
can be obtained by adding a chord to the spanning tree is called a fundamental circuit of G.

Consider the spanning tree T (shown in bold) of the following graph.

The branches of G are ab, ac, cd. The chords of G are bc and bd.
The circuits of G are a − b − c − a, a − b − d − c − a and b − c − d − b
Addition of the chord cb to the tree T yields the circuit a − c − b − a
Addition of the chord db to the tree T yields the circuit a − c − d − b − a
Thus the fundamental circuits are a − c − b − a and a − c − d − b − a

Let G be a weighted connected graph and T be a spanning tree of G. Then the sum of weights on the
branches of G is called weight of the tree T . In general for a given graph G, we may have dierent spanning
trees of dierent weights. Among all the spanning trees the one which is having minimum weight is called a
shortest spanning tree (minimal spanning tree) of the graph.
Let T be a spanning tree of a graph G. Then the cut set containing exactly one branch of T is called funda-
mental cut set(basic cut set) of G with respect to T .
Problem:
Write down the branches and chords of the graphs shown below, by considering arbitrary spanning tree. Also
nd the fundamental circuits and fundamental cut sets with respect to the spanning tree considered.

6
A mathematics department at a university has acquired a collection of 12 dierent mathematics books on a
variety of subjects to be presented to students who have performed well on a mathematics exam (one book to
each successful student).
Let this be represented as a graph whose vertices are the students, say S1 , S2 , ..., S10 and the books, say
B1 , B2 , ..., B12 , where two vertices of the graph are adjacent if one of these vertices is a student and the other
is a book that this student would like to have.

Certainly then, the graph is a bipartite graph with partite sets U = {S1 , S2 , ..., S10 } and W = {B1 , B2 , ..., B12 }.

A set of edges in a graph is independent if no two edges in the set are adjacent. By a matching in a
graph G, we mean an independent set of edges in G.
Let G be a bipartite graph with partite sets U and W , where r = |U | ≤ |W |. A matching in G is therefore a
set M = {e1 , e2 , ..., ek } of edges, where ei = ui wi for 1 ≤ i ≤ k such that u1 , u2 , ..., uk are k distinct vertices
of U and w1 , w2 , ..., wk are k distinct vertices of W . We say that M matches the set {u1 , u2 , ..., uk } to the set
{w1 , w2 , ..., wk }.
Necessarily, for any matching of k edges, we must have k ≤ r. The term matching is used since the edges of M
match or pair o k elements of U with k elements of W . The question in which we are interested can now be
phrased as follows: Does G contain a matching of cardinality r?

Example: As a result of doing well on an exam, six students Ashley (A) , Bruce (B) , Charles (C) , Duane
(D) , Elke (E) and Faith (F) have earned the right to receive a complimentary textbook in either algebra (a),
calculus (c), dierential equations (d) , geometry (g) , history of mathematics (h) , programming (p) or topology
(t) . There is only one book on each of these subjects. The preferences of the students are
A : d, h, t, B : g, p, t, C : a, g, h, D : h, p, t, E : a, c, d, F : c, d, p.
Can each of the students receive a book he or she likes?
This situation can be modeled by a bipartite graph as shown below having partite sets
U = {A, B, C, D, E, F } and W = {a, c, d, g, h, p, t}.

Each student receives a book as shown in the second graph.

Example: Seven seniors Ben(B), Don(D), Felix(F), June(J), Kim(K), Lyle(L) and Maria(M) are looking
for positions after they graduate. The University Placement Oce has posted open positions for an accoun-
tant(a), consultant(c), editor(e), programmer(p), reporter(r), secretary(s) and teacher (t). Each of the seven
students has applied for some of these positions: B : c, e; D : a, c, p, s, t; F ; c, r; J : c, e, r; K : a, e, p, s; L : e, r;
M : p, r, s, t . Is it possible for each student to be hired for a job for which he or she has applied?

This situation can be modeled by the bipartite graph as below, where one partite set U = {B, D, F, J, K, L, M }
is the set of students and the other partite setW = {a, c, e, p, r, s, t} is the set of positions.

The situation has no solution as four students Ben, Felix, June and Lyle have applied for some or all three
positions of consultant, editor and reporter.

7
Let G be a bipartite graph with partite sets U and W such that |U | ≤ |W |. For a nonempty set X of U ,
the neighborhood N (X) of X is the union of the neighborhoods N (x), where x ∈ X . Equivalently, N (X)
consists of all those vertices of W that are the neighbors of one or more vertices in X . The graph G is said to
satisfy Hall's condition if |N (X)| ≥ |X| for every nonempty subset X of U .
The partite set U = {B, D, F, J, K, L, M } in the bipartite graph of the above example does not satisfy Hall's
condition since the subset X = {B, F, J, L} of U has the property that |N (X)| < |X|. It turns out, however,
that the bipartite graph G of the above example does satisfy Hall's condition.

Theorem: Let G be a bipartite graph with partite sets U and W such that r = |U | ≤ |W |. Then G contains
a matching of cardinality r if and only if G satises Hall's condition.

Let {S1 , S2 , ..., Sn }be nonempty nite sets. Then this collection of sets has a system of distinct representa-
tives if there exist n distinct elements x1 , x2 , ..., xn such that xi ∈ Si for 1 ≤ i ≤ n. Of course, in order for the
sets S1 , S2 , ..., Sn to have a system of distinct representatives, |S1 ∪ S2 ∪ ... ∪ Sn | ≥ n.
For example, consider the sets S1 , S2 , ..., S7 , where
S1 = {1, 2, 3}, S2 = {2, 4, 6}, S3 = {3, 4, 5}, S4 = {1, 4, 7}, S5 = {1, 5, 6}, S6 = {3, 6, 7}, S7 = {2, 5, 7}. Then this
collection of sets has a system of distinct representatives. In particular,
1, 2, ..., 7 (that is, i ∈ Si for i = 1, 2, ..., 7) is a system of distinct representatives. On the other hand, the sets,
S10 , S20 , ..., Sn0 where S10 = {1, 3, 5, 6}, S20 = {3, 4}, S30 = {4, 5}, S40 = {3, 4, 5}, S50 = {1, 2, 4, 6}, S60 = {3, 5}, do not
have a system of distinct representatives as S20 ∪ S30 ∪ S40 ∪ S60 = {3, 4, 5} , so distinct representatives do not exist
for the sets S20 , S30 , S40 , S60 . These examples may very well suggest that what is needed for a collection of sets to
have a system of distinct representatives is exactly what is required in a bipartite graph G to have one partite
set U matched to a subset of the other partite set W of G.

Theorem: A collection {S1 , S2 , ..., Sn } of nonempty nite sets has a system of distinct representatives if
and only if for each integer k with 1 ≤ k ≤ n, the union of any k of these sets contains at least k elements.

Theorem:(The Marriage Theorem) In a collection of r women and r men, a total of r marriages between
acquainted couples is possible if and only if for each integer k with 1 ≤ k ≤ r, every subset of k women is
collectively acquainted with at least k men.

Matching of maximum cardinality, is called a maximum matching.


If a graph G of order 2k has a matching M of cardinality k, then this (necessarily maximum) matching M is
called a perfect matching as M matches every vertex of G to some vertex of G.

Theorem: Every r-regular bipartite graph (r ≥ 1) has a perfect matching.


Problem:
Let G be the bipartite graph with partite sets U = {u0 , u1 , ..., u6 } and W = {w0 , w1 , ..., w6 }. Does G contain a
perfect matching? If no, explain why not; if yes, draw a perfect matching and indicate what this means in this
case.

Ans: A perfect matching of G is M = {u0 w6 , u1 w1 , u2 w0 , u3 w5 , u4 w2 , u5 w4 , u6 w3 }.

Problem:
The below gure shows two bipartite graphs G1 and G2 , each with partite sets U = {v, w, x, y, z} and
W = {a, b, c, d, e}. In each case, can U be matched to W ?

Ans: A perfect matching of G1 is M = {cv, bw, dx, ey, az}.


There exists no matching of G2 as the subset X = {v, x, y} has N (X) = {a, c}, such that, |N (X)| < |X|.

8
A vertex cover of a graph G is a set Q ⊆ V (G) that contains at least one endpoint of every edge. The
vertices in Q cover E(G).

The minimum size of a vertex cover is denoted as β(G).


In the above graphs, the vertices of the vertex cover is marked with square.

Min-Max Theorem:
If G is a bipartite graph, then the maximum size of a matching in G equals the minimum size of a vertex cover
of G.
In the below bipartite graph, the maximum matching is denoted by bold edges and the minimum vertex cover
is squared.

Find a maximum matching in each graph below.

Ans: G1-3, G2-3, G3-4

A clique in a graph is a set of pairwise adjacent vertices.


An independent set(stable set) in a graph is a set of pairwise non adjacent vertices.

In the graph G. {u, x, y} is a clique of size 3 and {u, w} is an independent set of size 2, and these are the largest
such sets. These values reverse in the complement G, since cliques become independent sets(and vice versa)
under complementation.
The independence number of a graph is the maximum size of an independent set of vertices.

The above graph is marked with an independent set of size 4.


The maximum size of an independent set is denoted as α(G).
An edge cover of G is a set L of edges such that every vertex of G is incident to some edge of L.

In the above graph the edge set {ux, vx, wy, wz}, is0 an edge cover.
The minimum size of an edge cover is denoted as β (G).
In a graph G, a set S ⊆ V (G) is a dominating set if every vertex not in S has a neighbor in S . The domi-
nating number γ(G) is the minimum size of a dominating set in G.

In the above graph, the dominating sets of size 3 are squared and the dominating sets of size 4 are circled.

9
Network is a 4-tuple G, c, s, t, where (G, c) is a weighted graph with non-negative weight c ≥ 0 and
s, t ∈ V (G) are called source vertex and sink vertex.
A cut is a set of edges whose removal will divide/separate the network into 2 halves X and Y where: (source)
S ∈ X and (sink) T ∈ Y .
The capacity of a cut is sum of the weights on the edges of a cut.

Max-ow, Min-cut Theorem:


The maximum ow between two vertices A and B in a Transport Network is equal to capacity of the minimum
cut w.r.t. A and B .
Proof: Let G be a connected graph representing the Transport Network.
S a cut set w.r.t. A and B
G − S a subgraph with no path between A and B .
∴ every path in G between A and B must contain at least one edge of S .
Thus every ow between A and B must pass through at least one edge of S .
Hence the total ow-rate between A and B cannot exceed the capacity of S .
Since S is arbitrary, the result holds good for every cut set.
Problem:
1. Find the max-ow between A and Z by identifying the cut set with minimum capacity.

The cut sets w.r.t. the vertices A and Z are


S1 = {BZ, CZ}, Capacity of S1 = 8 + 7 = 15
S2 = {AB, BC, CZ}, Capacity of S2 = 6 + 5 + 7 = 18
S3 = {AB, AC, DC}, Capacity of S3 = 6 + 3 + 4 = 13
S4 = {AD, AC, AB}, Capacity of S4 = 2 + 3 + 6 = 11
S5 = {DC, AC, BC, BZ}, Capacity of S5 = 4 + 3 + 5 + 8 = 20
Maximum ow = min{Cap(S1 ), Cap(S2 ), Cap(S3 ), Cap(S4 ), Cap(S5 )}
= min {15, 18, 13, 11, 20} = 11
∴ max ow = 11.
2. Find the max-ow between A and D by identifying the cut set with minimum capacity.

The cut sets w.r.t. the vertices A and D are


S1= {AB, AF }, Capacity of S1 = 5 + 4 = 9
S2= {AB, BF, F E}, Capacity of S2 = 5 + 3 + 3 = 11
S3= {AB, BF, CE, ED}, Capacity of S3 = 5 + 3 + 1 + 8 = 17
S4= {AF, F B, BC}, Capacity of S4 = 4 + 3 + 4 = 11
S5= {AF, F B, CE, CD}, Capacity of S5 = 4 + 3 + 1 + 2 = 10
S6= BC, F E , Capacity of S6 = 4 + 3 = 7
S7= BC, CE, ED, Capacity of S7 = 4 + 1 + 8 = 13
S8= F E, EC, CD, Capacity of S8 = 3 + 1 + 2 = 6
S9= CD, ED, Capacity of S9 = 2 + 8 = 10
Maximum ow = min{Cap(S1 ), Cap(S2 ), Cap(S3 ), Cap(S4 ), Cap(S5 ), Cap(S6 ), Cap(S7 ), Cap(S8 ), Cap(S9 )}
= min {9, 11, 17, 11, 10, 7, 13, 6, 10} = 6
∴ max ow = 6.

In the below networks, nd a maximum ow from s to t.

10
Traveling Salesman Problem:
Let G be a weighted graph.The problem of nding a minimum cost Hamiltonian Cycle in a weighted graph G
is called the Traveling Salesman Problem.
The Nearest-Neighbour algorithm is a type of Greedy algorithm which means that at every stage of the algo-
rithm we pick the best possible edge to use.

The below graph gives the distance between 5 dierent places. Suppose a salesman starts at A, nd the
total round-trip distance made by him as short as possible.

Starting at A, we have 4 edges to choose from. Edge AD has the least weight, so we choose this edge. Among
the edges incident with D, DC has the least weight. So we choose this edge. Among the edge incident with
C, CA has the least weight. As, we have to every other vertex, before coming back to A, we choose the next
available least weighted edge. That is CE. Following the same procedure, we choose the edges EB and then BA.
The total trip distance is = 6+5+9+11+8 = 39. The Hamiltonian Cycle formed is shown with bold edges in
the below graph.

Solve the below TSP by starting at the vertex A.

11

You might also like