Notes-UNIT V - Graph Theory
Notes-UNIT V - Graph Theory
Introduction
Examples
Computer networks
Basic Definitions
A graph is any collection of Vertices (Dots) and Edges (Arcs/Lines)
that join the points.
u v
Disregards any sense of dir
u v
Loop or self loop: A loop is an edge whose end points are equal i.e., an
edge joining a vertex to itself is called a loop. Represented as {u, u} =
{u}.
Multiple Edges or parallel edges: Two or more edges joining the same
pair of vertices.
Adjacent vertices: Two vertices are adjacent if they are the endpoints of
an edge.
Finite graph : A graph whose vertex set and edge set are finite.
Null graph : A graph whose vertex set and edge set are empty.
Empty graph : In a graph vertices exists, but no edges exits
All vertices are isolated vertices, then it is an empty graph
Pseudo graph : A graph in which loops and parallel edges are allowed.
Simple graph : A graph in which loops and parallel edges are
not allowed
Note: Graphs generally means , it is simple graphs.
Degree of a vertex
The degree of a vertex in an undirected graph is the number of
edges incident with that vertex.
[count the number of edges connected to a vertex]
u v
number edges coming towards the vertex number of edges for which
u is terminal vertex.
In the above diagram, For V={u, v, w}, E={ (u, w), ( v, w), (u, v) },
deg-(u)=0, deg+(u)=2,
deg-(v)=1, deg+(v)=1,
Note:
Types of graphs
i) Regular graph
II) Multi graphs - Graph with self loops and (OR) parallel edges
Simple graphs
This is not simple graph since it has multiple edges and loops.
Regular graph
c b
Since d(a)=d(b)=d(c)=d(d)=3
Note:
Bipartite Graph
v1
v2
Complete bipartite graph Km,n
The complete bipartite graph Km,n is the graph that has its vertex set
partitioned into two subsets of m and n vertices, respectively. Two
vertices are connected if and only if they are in different subsets.
v1
v2
Multigraph
The sum of the degrees of all the vertices of an undirected graph is twice
the number of edges of the graph and hence even.
Result:
Problems:
If all the vertices of an undirected graph are each of odd degree k, show
that the number of edges of the graph is a multiple of k.
Soln.
i.e., ∑2𝑛
𝑖=1 𝑘 = 2𝑛𝑒 or 2𝑛𝑘 = 2𝑛𝑒
∴ 𝑛𝑒 = 𝑛𝑘
a) A B C
D F
E
A
V1
b) V2 V5
V3 V4
a) No. of vertices =6
No. of edges = 9
sum of the degrees of all the vertices = 2* number of edges
deg(A) =2 , deg(B) =5, deg(C) =3, deg(D) =3, deg(E) =3, deg(F) =2
LHS = deg( v ) 2 5 3 3 3 2 18
i i
RHS = 2* No, of edges = 2*9 =18
Hence handshaking theorem is verified.
b) vertices=5, edges =8
d(v1) =4, d(v2) =5 d(v3) =2, d(v4)=2, d(v5)=3
Sum of degree of all vertices= 16
2*e =2*8 =16 Hence handshaking theorem is verified.
c) If the a graph in which 2 vertices having degree 3 and remaining
vertices are having degree 2 and the total no. of edges 21 then how many
vertices are there?
sum of the degrees of all the vertices = 2* number of edges
(2*3)+(x*2) =2*e =2*21 =42
6+2x =42
2x =42-6=36
x =18 remaining vertices
no. of vertices = 18+2 =20
x =10
Problems
1) Find the number of vertices, the number of edges and the degree of
each vertex in the following undirected graph and verify handshaking
theorem.
Solution
The number of vertices = 6
The number of edges = 9
deg(A)= 2 ; deg(B)=4; deg(C)=4; deg(D)=3; deg(E)=4 ; deg(F)=1
sum of degree of all vertices = 18
2*e=2*9 =18
hence handshaking theorem is verified
2) Find the number of vertices, the number of edges and the degree of
each vertex in the following undirected graph and verify handshaking
theorem.
Solution
The number of vertices =5
The number of edges =13
deg(A)= 6 ; deg(B)=6; deg(C)=6; deg(D)=5; deg(E)=3
Solution
𝑑𝑒𝑔− (𝐴) = 2, 𝑑𝑒𝑔− (𝐵) = 1, 𝑑𝑒𝑔− (𝐶) = 2, 𝑑𝑒𝑔− (𝐷) = 3, 𝑑𝑒𝑔− (𝐸) = 0
𝑑𝑒𝑔+ (𝐴) = 1, 𝑑𝑒𝑔+ (𝐵) = 2, 𝑑𝑒𝑔+ (𝐶) = 1, 𝑑𝑒𝑔+ (𝐷) = 1, 𝑑𝑒𝑔− (𝐸) = 3
∑ 𝑑𝑒𝑔− (𝐴) = ∑ 𝑑𝑒𝑔+ (𝐴) = 8=the number of edges.
4) Find the in-degree and out-degree of of each vertex of each of the
following directed graphs also verify that the sum of the in-degrees or the
out-degrees equals the number of edges
Solution
𝑑𝑒𝑔− (𝐴) = 5, 𝑑𝑒𝑔− (𝐵) = 3, 𝑑𝑒𝑔− (𝐶) = 1, 𝑑𝑒𝑔− (𝐷) = 4 𝑑𝑒𝑔+ (𝐴) = 2, 𝑑𝑒𝑔+ (𝐵) =
3, 𝑑𝑒𝑔+ (𝐶) = 6, 𝑑𝑒𝑔+ (𝐷) = 2
∑ 𝑑𝑒𝑔− (𝐴) = ∑ 𝑑𝑒𝑔+ (𝐴) = 13 =the number of edges.
5) For each of the following degree sequences find if there exists a graph.
In each case either draw a graph or explain why no graph exists.
a) 4,4,4,3,2
b) 5,5,4,3,2,1
c) 3,3,3,3,2
d) 3,3,3,3,3,3
e) 5,4,3,2,1,1
Solution
a) Sum of the degrees of all the vertices = 17 which is an odd number.
This is impossible.
Handshaking: Sum of degree of all vertices = 2 e
Hence no graph exists with the given degree sequence.
b) 5,5,4,3,2,1
There are 6 vertices. Hence a vertex of degree 5 in the graph must be
adjacent to all other vertices.
As there are two vertices each of degree 5 all other vertices should be of
degree at least 2. But the given degree sequence contains a 1.
Hence no graph is possible with the given degree sequence.
c) 3,3,3,3,2
d) 3,3,3,3,3,3
A simple graph with the given description is possible.
e)
Solution:
a)
Let us try partitioning of the vertices into two subsets satisfying the
conditions of a bipartite graph.
v1= {A,C,F}
v2 ={B,D,E}
The vertices of 𝑉1 are connected by edges to the vertices of 𝑉2 but the
vertices A, F, C of the subset 𝑉1 are connected by the edges CF
Hence the graph(a) is not a bipartite graph.
v1= {A, C}
v2={B, D, E}
Hence the given graph(b) is bipartite.
Now for a bipartite graph to be completely bipartite, each vertex of the
subset 𝑉1 must be adjacent to every vertex of 𝑉2.
Both A and C are adjacent to each of B, D, E
Hence the graph(b) is a completely bipartite graph.
Representation of graphs
Incidence matrix
Example: G = (V, E)
e1 e2
1
e3
1 2 3 4 5 6
a
1 a 1 1 0 0 1 0
2 b 1 0 1 0 0 0
M
b c 0 0 0 1 1 1
d 0 1 1 1 0 0
d 3
5
4
c
A = [aij] of order N
Note:
Using sparse matrices to store data that contains a large number of zero-valued
elements can both save a significant amount of memory and speed up the processing of
that data. sparse is an attribute that you can assign to any two-dimensional MATLAB®
matrix that is composed of double or logical elements.
Directed Multigraphs can be represented by using aij = number of
edges from vi to vj
Example: Undirected Graph G (V, E)
Solution: 0 1 1 1
1 0 0 1
AG
1 0 0 1
1 1 1 0
Practice Problems
A B C D E
A
B
C
D
E
a) ----------Ans :
In Simple graph Degree of the vertices can be given by counting no. of ones in each row
Since all the leading diagonals are zero entries then there is no self loop
A B C D
A
B
C
D
b) ----------------Ans :
Since all the leading diagonals are 1's entries then there is a self loop.
A
B
a) -------------------Ans :
b) -------------------Ans:
c) --------------------Ans :
a) -----------------Ans:
b) ---------Ans:
c) -------Ans:
a) -----------Ans:
b) ------------Ans:
e3
c) ----------Ans :
**********************************************************************************
Matrix Representation of Graphs
When G is a simple graph with n vertices v1, v2, v3, …. vn, the matrix A (or
1 , 𝑖𝑓 𝑣𝑖 𝑣𝑗 𝑖𝑠 𝑎𝑛 𝑒𝑑𝑔𝑒 𝑜𝑓 𝐺
AG)[aij], where 𝑎𝑖𝑗 = { is called the adjacency matrix
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
of G.
For example, if G is the graph given in the following figure, then the
adjacency matrix A is
V1 V2 V3 V4 V1 V2
V1
V2
V3
V4
V4 V3
G
2. The adjacency matrix of simple graph is symmetric, viz., 𝑎𝑖𝑗 = 𝑎𝑗𝑖 , since
both of these entries are 1 when 𝑣𝑖 and 𝑣𝑗 are adjacent and both are 0
otherwise. Conversely, given any symmetric zero-one matrix A which
contains only 0’s on its diagonal, there exists a simple graph G whose
adjacency matrix is A.
3. deg(𝑣𝑖 ) is equal to the number of 1’s in the ith row or ith column.
V3 V5
.
Open walk
A walk is said to be an open walk if the starting and ending vertices are
different i.e. the origin vertex and terminal vertex are different.
Closed walk
A walk is said to be a closed walk if the starting and ending vertices are
identical i.e. if a walk starts and ends at the same vertex, then it is said
to be a closed walk.
In the above diagram:
v1-v2-v3-v4-v5-v3 is an open walk.
v1-v2-v3-v4-v5-v3-v1 is a closed walk.
Trail
Trail is an open walk in which no edge is repeated.Vertex can be repeated.
V1 V2
V4
V5
V3 V7
V6
V9
V8
Here v1-v3-v8-v6-v3-v2 is trail
v1-v3-v8-v6-v3-v2-v1 is a closed trail.
V2
V4
V1
V3
V6
V5
Note.
Circuit is a closed trail.
These can have repeated vertices only.
Path
V1 V4
V2
V5
V3 V7
V6
V9
V8
repeated.
v1-v2-v3-v1
v1-v2-v4-v5-v7-v8-v3-v1: length is 7
Length The length of a walk, trail, path or cycle is its number of edges.
(Necessary conditions)
and G2.
If these conditions are satisfied in two graphs, we can say that the two
graphs G1 and G2 are isomorphic graphs.
(Sufficient Conditions)
Theorem 1:
Two graphs are isomorphic, if and only if their vertices can be labelled
Theorem2:
If two graphs are isomorphic, they will contain circuits of the same
Example 1:
Necessary conditions
Soln.
vertices.
2. The number of edges in both graphs G1 and G2 are same. i.e., 4 edges.
Sufficient condition
A B C D
A 0 1 1 0
B 1 0 0 1
Adjacency matrix of G1 is
1 0 0 1
C
0
D
1 1 0
V1 V2 V3 V4
V1
0 1 1 0
V2 1 0 0 1
1 1
Adjacency matrix of G2 is
0 0
0
V3
V4
1 1 0
The two adjacency matrices are same. Hence two graphs are
isomorphism.
Example 2:
V6 V6 ‘
V1 V2 V3 V4 V1 ‘ V2 ‘ V3 ‘ V4 ‘ V5 ‘
11 11 11
V5
G1 G2
Soln.
i.e., 6 vertices.
2. The number of edges in both graphs G1 and G2 are same. i.e., 5 edges.
i.e., There are 3 vertices namely v1, v5, v6 (v1’, v5’, v6’) each of degree 1;
Thus, all the three conditions are satisfied but the two graphs G1 and G2
are not isomorphic because the vertices v2 and v3 are adjacent in G1,
whereas the corresponding vertices v2’ and v4’ are not adjacent in G2.
Problems:
1. Determine whether the following pairs of graphs are isomorphic.
exist.
Soln.
Thus, the above two graphs agree with respect to the necessary
conditions.
4. Still, we cannot conclude that the two graphs are isomorphic, unless
b) V1
11
u1 u2
11
V2
V5
11
u5 11
11
u4 u3 V4 V3
11 G1 11 11 G2 11
11 11
Soln.
vertices are of degree 3 each. In the other graph G2, 2 vertices v1 and
equal number of edges in the two graphs, the degree of vertices are
not invariant. Hence the two graphs are not isomorphic.
isomorphic.
A B O P
F 1 S
E
1 T
1
H G V 1
U
D C R Q
G1 G2
11 11
Soln.
D C V4 V3
G1 G2
In graph G1,
cycle of length 3:
cycles of length 4:
u2 u3
u1 u4
u6 u5
G1
v2 v3
v1
v4
v6 v5
G2
Soln.
degree 2.
v5
v2
u5 u2
u4 u3 v4 v3
G1 G2
Soln.
degree 2.
4. The two graphs G1 and G2 have circuits of length which pass through all
vertices, namely u1-u2-u3-u4-u5-u1 and v5-v3-v2-v1-v4-v5.
In both the circuits, the degree of the ordered vertices are 3,2,3,2,2. The
two graphs are isomorphic as their adjacency matrices are the same.
u1 u2 u3 u4 u5 v5 v3 v2 v1 v4
0
u1
1 1 0 1 0v5 1 1 0 1
u
12 0 1 0 0 v
1 3 0 1 0 0
𝐴𝐺1 ≡ u
31 1 0 1 0 𝐴𝐺1
≡v 1 2 1 0 1 0
0 0 1 0 1
0 0 1 0 1
u v 1
4
u
1
5 0 0 1 0 v
1 4 0 0 1 0
B C v2 v3
G1 G2
b)
A D a c
E H e g
F G f h
B C b d
G1 G2
Soln.
a)
4. Now A-B-D-A, A-C-D-A and A-B-C-A are circuits of length 3 each in G1.
each in G1.
b)
G1, but there are two circuits of length 4 each from a to a, namely,
a-b-d-c-a and a-e-g-c-a. Hence the two graphs G1 and G2 are not
isomorphic.
Practice Problems:
u1 V1
a)
V5
u2 u5 V2
u3 u4 V3 V4
G1 G2
A
b) P Q
E B
T R
D C
S
G1 G2
c)
u1 u2 u3 u5 u6 v1 v2 v4 v5 v6
v8
u8
u4 u7 v7
v3
G1 G2
C V8 e12
D 6
11 V7
e8 11
8 7
e6
12 e7
V4 e11
H G V3
2 11 e10
10 11 4 11
e9
e2 V6
3 E 9 5
F V5
e4 11
e3 11 e5
V1
A 1 B e1 V2
11
11
G1 G2
Walk - Path, Cycles- Eulerian graphs -Hamiltonian graphs- Planar
graphs- Euler formula.
Walk
Here 1- 2- 3- 4- 2- 1- 3 is a walk.
Note.
1. Walk can be open or closed.
2. Walk can repeat anything (edges or vertices).
Open walk-A walk is said to be an open walk if the starting and ending
vertices are different i.e. the origin vertex and terminal vertex are
different.
Closed walk-A walk is said to be a closed walk if the starting and ending
vertices are identical i.e. if a walk starts and ends at the same vertex,
then it is said to be a closed walk.
In the above diagram:
1-2-3-4-5-3 is an open walk.
1-2-3-4-5-3-1 is a closed walk.
2. Trail
Trail is an open walk in which no edge is repeated.
Vertex can be repeated
3. Circuit –
Traversing a graph such that not an edge is repeated but vertex can be
repeated and it is closed also i.e. it is a closed trail.
Vertex can be repeated
Edge not repeated
Note.
Circuit is a closed trail.
These can have repeated vertices only.
4. Path –
It is a trail in which neither vertices nor edges are repeated i.e. if we
traverse a graph such that we do not repeat a vertex and nor we repeat
an edge. As path is also a trail, thus it is also an open walk.
Vertex not repeated
Edge not repeated
5. Cycle –
Traversing a graph such that we do not repeat a vertex nor we repeat a
edge but the starting and ending vertex must be same i.e. we can repeat
starting and ending vertex only then we get a cycle.
Vertex not repeated
Edge not repeated
Length
v1 e4 v4
e8
e6
e3 v5
e1 e5
e7
v2 e2 v3
Walk: v1 e1 v2 e2 v3 e5 v1 e4 v4 e8 v5
Path : v1 e4 v4 e6 v2 e2 v3 e7 v5 : Length = 4
2. Find which of the following vertex sequence are walks and paths.
A B
E
D
a) A-D-E-B-C
Not a path and not a walk, since the edge DE is not in the graph.
3) Find all simple paths from A to F of length 3,4,5 and find the circuits.
B C
A F
D E
E
Path of length 3: 1) A-B-C-F 2) A-D-E-F
Example
G
D
B
Disconnected graph
A B
C
E
D
2) Find all the connected subgraphs of the graph of the following graph G
C D G
A B
F E
Solution.
The connected subgraphss are
a)
C D G
A B
F E
C D G
A B
F E
The path from A-G is A-B-C-F-E-D-G which contains all the vertices of the
original graph.
(𝑛−𝑘)(𝑛−𝑘+1)
Maximum number of edges in G =
2
Example:
strongly connected
Unilaterally connected
weakly connected
Problems:
1. Find which of the following graphs are strongly, weakly and unilaterally
connected.
a)
A B
D C
Strongly connected, since there is a path from each of the possible pair
of vertices, namely (A,B),(A,C),(A,D),(B,C),(B,D),(C,D).
A D
B C
Unilaterally connected, since there is one way path between the pair of
vertices.
C)
A B
E D
strongly connected, since there is a two way path from all the pairs
vertices
D)
A B
E D
1) Euler graph
1 b
a d
3
2 4
7
f e
6 c 5
Here degree of vertex b and d is 3, an odd degree and violating the Euler
graph condition.
3)
4)
5)
6)
7) Find Euler path and Euler circuit in the following graphs.
a)
B
A
C E
D
b)
B
A
F C
E D
c)
C
A
D
E
In above example, sum of degree of a and c vertices is 6 and is greater than total vertices, 5 using
Ore's theorem, it is an Hamiltonian Graph.
Also a 1 b 2 c 4 e 7 d 8 a is a closed path containing all the vertices of G exactly once.
Non-Hamiltonian Graph
There is no closed path which contains all the vertices exactly once.
3)
A
C
E
B D
F
1)
C D
Eulerian graph since the Euler circuit C-A - B - D-C-E-B-F-C exits.
2)
B C
A E
Non Eulerian graph, Since there are 4 vertices (A,B) having degree 3 .
6)
Planar graph representation
A graph G is said to be planar if there exists some geometric
representation of the graph, which can be drawn on a plane such that no
two of its edges intersect . That is, the edges never cross over.
A graph that cannot be drawn on a plane without cross over between the
edges is called a non planar graph.
Example.
A
B
A B
C D C D
Original graph planar representation
3)
original graph
planar graph
Non-Planar graph -problems
A
A
B C
B C
D E
D E crossing
A B B
C
A C
E F
E D
D F
cross
Original graph non planar representation
3)
A B
F
C
E D crossing
Unbounded region
The portion that lies outside the graph is referred as the unbounded
region.
Region in planar graphs
Example. 6 regions
R4
R2
R3
R1
R5
R6
Euler's formula
Example
[handshaking theorem]
60 = 2E implies E = 30 edges
f = E - V +2
= 30 - 20 +2
f= 12 regions
R1
R2
Answer
utilities
utilities
1. Verify Euler’s formula for the following graphs:
(a)
(b)
2. Can the following graphs be drawn as planar graphs? If so, verify Euler’s formula
(a)
(b)
(c)
Shortest path Algorithm
DIJKSTRA’S ALGORITHM
Introduction
To find the length (or weight) of the shortest path between two vertices , say, ‘a’
and ‘z’ in a weighted graph, the algorithm assigns numerical labels to the vertices
of the graph by an iterative procedure.
At any stage of iteration, some vertices are labelled temporarily (that are not
bracketed) and others will have permanent labels (that are bracketed). The label
of the vertex V is denoted by L(V).
Procedure:
2.Iteration1:Let V1 be the set of all vertices v1 which are same as v0 excluding v0*.
For elements of V1 that are adjacent to v0*, the temporary lebels are revised using
L(v1)=L(v0*)+W(v0*v1)
L(v0*)=0, W(v0*v1) is weight of the edge v0*v1. For other elements of V1,
previous temporary labels are maintained.
Let v1* be the vertex among the v1‘s for which L(v1) is minimum. If there is a tie
for choice of v1*, it is broken arbitrarily.
Now L(v1*)is given a permanent label.
Let V2= V1-{v1*}={v2}
3.Iteration i: For elements of Vi, that are adjacent to vi-1* , the temporary labels are
revised using L(vi)=L(vi-1*)+W(vi-1*vi) and for other elements of vi, previous
temporary labels are not altered.
** The procedure is stopped when final vertex Z is assigned a permanent label even
though some vertices might not have been assigned permanent labels.
*The permanent label of Z is the length of the shortest path from a to Z.
Problems:
1. Find the shortest path from the vertex A to F using Dijkstra’s Algorithm.
3 V3 : A* B* C* D E F E is adjacent vertex to C*
L(V3): - - - 7 (4) L(E)= L(C*)+ L(C*E)=3+5=8, Previous L(E)=4 [from B*]
Min{L(E), Pre.L(E)}=Min{8,4}=4
Thus, L(E*)=4 is bracketed from B*
4 V 4 : A* B* C* D E* F D and F are adjacent vertices to E*
L(V4): - - - (5) - 8 L(D)= L(E*)+ L(E*D)=4+1=5; L(F)= L(E*)+ L(E*F)=4+4=8
Previous L(D)=7
Min{L(D), Pre.L(D), L(F)}=Min{5,7,8}=L(D)=5
Thus, L(D*)=5 is bracketed.
5 V5 : A* B* C* D* E* F F is the only vertex adjacent to D*
L(V5): - - - - - (7) L(F)= L(D*)+ L(D*F)=5+2=7
Min{L(F), prev L(F)}= Min{7,8}= L(F)=7
L(F*)=7.
Since L(F*)=7, the length of the shortest path from A to F = 7
To find shortest path:
D D* from E*
EE* from B*
2.Using Dijkstra’s Algorithm, find the shortest path between the vertex A and H
in the Weighted Graph.
6
A
0 V0 : A B C D E F G H a is permanently labeled as a*
L(V0): (0) L(a*)=0
1 V1 : A* B C D E F G H b and f are adjacent to a*
L(V1): - 2 (1) L(b)=2, L(f)=1
Min(L(b),L(f))=Min(2,1)= L(f)=1
L(f*) =1 is bracketed
2 V2 : A* B C D E F* G H g and d are adjacent to f*
L(V2): - (2) 4 - 7 L(g)=L(f*)+L(f*g)=1+6,=7
L(d)= L(f*)+L(f*d)=1+3 =4
Min{L(g),L(d),L(b)}=Min{7,4,2}= L(b)=2
L(b*)=2 is bracketed
e is adjacent to d*
L(e)=L(d*)+L(d*e)=4+4=8
Min{L(e),
preL(e),L(g)}=Min{8,7,7}=L(e)=L(g)=7
Logically in previous step L(h)=5
3)
Use Dijkstra’s Algorithm to find the shortest path between the vertex A and F in
the given Weighted Graph.
B 6 D
1 2
5 3
A 2 F
4
7
C
1 E
Sol:
Iteration Iteration Details Remarks
Number
Shortest Path: A – B – C – E – D – F
b 5 d
4 6
a 8 2
1 f
2
3
c
10 e
Sol:
Iterati Iteration Details Remarks
on
Numb
er
3 V3 : a* b* c* d e f d is adjacent to b*
L(V3): - - - (8) 12 L(d)= L(b*)+ W(b*d)=3+5=8
Pre L(d)=10 (i.e., from c*)
Min{L(d),Pre.L(d)}=Min{8,10}=8
Thus, L(d*)=8 (from b*) is bracketed.
4 V4 : a* b* c* d* e f e and f are adjacent to d*
L(V4): - - - - (10) L(e)= L(d*)+ W(d*e)=8+2=10
14 L(f)= L(d*)+ W(d*f)=8+6=14
Previous L(e)=12 (i.e.,from c*)
Min{L(e),L(f),Pre.L(e)}=L(e)=10
Thus, L(e*)=10 (from d*) is bracketed.
5 V5 : a* b* c* d* e* f f is the only vertex adjacent to e*
L(V5): - - - - - L(f)= L(e*)+ W(e*f)=10+3=13
(13) Pre.L(f)=14 (from d*)
Min{L(f),Pre.L(f)}=Min{13,14}=L(f)
L(f*)=13 (from e*) is bracketed
Shortest path : a – c – b – d – e – f
5)
6)
7)
8)
Min{L(b),L(e),L(f)}
=Min{5,5,15}=L(e) [from c*] or L(b)=5(i.e., from
a*)
Thus, L(e*)=5 is bracketed (from c*)
L(d)=L(b*)+L(b*d)=5+5=10
f: f from g*
g*: g* from d*
b*: b* from a*
or
e*: e* from c*
c*:c* from a*
Length: 14 or 13