Professional Documents
Culture Documents
Paths, Rechability and Connectedness (Lecture Notes)
Paths, Rechability and Connectedness (Lecture Notes)
1
Contents
1 Introduction 3
1.1 Paths, Simple and elementary paths . . . . . . . . . . . . . . . . 3
1.2 Cycles or circuits, simple and elementary cycles . . . . . . . . . . 4
1.3 Reachability of a vertex and a set . . . . . . . . . . . . . . . . . . 5
1.4 Connectedness of the graph . . . . . . . . . . . . . . . . . . . . . 6
1.5 Applications to represent resource allocation status of an operat-
ing system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Detection and correction of deadlocks. . . . . . . . . . . . . . . . 9
2
1 Introduction
Definition 1.2. A path is said to traverse through the nodes appearing in the
sequence, originating in the initial node of the first edge and ending in the terminal
node of the last edge in the sequence.
Definition 1.3. The number of edges appearing in the sequence of a path is called
the length of the path.
For a simple digraph in Figure-1, some paths originates in the node 1 and ending
in node 3 are given by,
Definition 1.4. A path in a digraph in which the edges are all distinct is called a
simple path (edge-simple).
Definition 1.5. A path in which all the nodes through which it traverses are
distinct is called an elementary path (node simple).
3
Remarks:
1. Every elementary path of a digraph is a simple path. But every simple path
may not be elementary path.
3. A digraph containing only one self loop(Sling) or only one parallel edges is
a simple path.
4. In a path any vertex appears twice as either initial vertex or a terminal vertex
then it is called an elementary path.
Definition 1.7. A cycle is called simple cycle if its path is simple that is no edge
in the cycle appears more than once in the path.
Definition 1.8. A cycle is called elementary cycle if it does not traverse through
any node more than once.
Definition 1.9. A simple digraph which does not have any cycle is called acyclic.
C1 = {(1, 1)}
C2 = {(1, 2), (2, 1)}
C3 = {(1, 2), (2, 3), (3, 1)}
C4 = {(1, 4), (4, 3), (3, 1)}
C5 = {(1, 4), (4, 3), (3, 2), (2, 1)}
Remarks:
4
1.3 Reachability of a vertex and a set
Definition 1.10. A node v of a simple digraph is said to be reachable or accessible
from the node u of the same digraph, if there exists a path from u to v.
Definition 1.12. The length of a geodesic from the node u to the node v is called
the distance and is denoted by d(u, v).
Remarks:
Theorem 1.13. In a simple digraph, the length of any elementary path is less than
or equal to n − 1, where n is number of nodes in the graph. Similarly, the length
of any elementary cycle does not exceed n.
Definition 1.14. Consider a directed graph G = (V, E). The set of all nodes
which are reachable from a given node v is said to be reachable set of v. The
reachable set of v is written as R(v).
Definition 1.15. Consider a directed graph G = (V, E). For any subset S ⊆ V ,
the reachable set of the set S is the set of nodes which are reachable from any
node of S, and this set is denoted by R(S).
5
(, (, ,( (, ,(
2( (2 (2 2( (2
,4 ,4 4, ,4 4,
, , , , ,
4 4 4 4 4
)1 1
) 1 ) 1
) 1 )
,) ,) ), ,) ),
(, ,( ,( ,( ,(
4( 4( (4 4( (4
,1 1
, 1 , 1
, 1,
, , , , ,
1 1 1 1 1
)2 )2 2) )2 2)
,) ), ), ), ),
(, ,( ,( (, ,(
Figure( 2: Reachable set (and Node base ( (1
1( 1 1 1
,2 2, 2, ,2 2,
, the reachable set, of other nodes v6 ,, v7 , v8 , v9 and v10, are given ,by,
Similarly,
2 2 2 2 2
)3 R(v6 ) = {v )3 6 } , R(v7 ) = {v6 ,3)v7 } , R(v9 ) = {v)39 } 3) (2)
,) R(v10 ) =), {v10 } , v8 = {v6 ,),v7 , v8 } ), ),
(\ (\ \( (\ \(
Finallly,2r the nodebase of ther2 graph G = (V, E) r2 is given by, r2 r2
3. No pair of nodes in the node base are reachable from one another.
4. Any node from the elementary cycle can be included in the node base.
5. Any node with non-zero in degree and that does not lie on any cycle can’t
be node of the node base.
Definition 1.20. If for any pair of nodes of the graph both the nodes of the pair
are reachable from one another, then the graph is called strongly connected.
6
Figure 3: Strongly connected, Weekly connected and not Unilaterally connected,
Unilaterally connected but not Strongly connected
Remarks:
2. In a weekly connected digraph we may find that for any pair of nodes say u
and v, neither u is reachable from v nor v is reachable from u.
7
Remarks:
1. The subsets {1, 2, 3} , {4} , {5} and {6} are strong components.
2. The subsets {1, 2, 3, 4, 5} and {6} are unilateral component.
3. The set {1, 2, 3, 4, 5, 6} is weakly component.
Theorem 1.25. In a simple graph G = (V, E), every node of the digraph lies in
exactly one strong component.
Proof. Let v ∈ V and S = R(v) ⊂ V be the set of all those of nodes of G which
are mutually reachable with v. Hence the set S naturally contains v and is a strong
component. This shows that every node of G is contained in a strong component.
Assume that the node v lies in two components W = R(v) and Z = R(v).
Then every node in W through v is reachable to every node in Z. Which is not
possible. Hence every node lies one strong component.
Similar kinds of result can be stated for weak component and unilateral compo-
nent.
Corollary 1.26. Every node and edge of a simple digraph contained in exactly
one weak component.
Corollary 1.27. Every node and edge of a simple digraph contained in exactly
one unilateral component.
A directed graph can be used to model resource requests and assist in the detection
and correction of deadlocks.
8
1.6 Detection and correction of deadlocks.
Let Pt = {p1 , p2 , . . . . . . , pm } represents the set program in the computer system
at time t. Let Ai ⊆ Pt be the set of active programs, or programs that have
been allocated at least a portion of their resource requests at time t. Finally, let
Rt = {r1 , r2 , . . . . . . , rn } represent the set of resources in the system at time t.
An allocation graph Gt is a directed graph representing the resource allocation
status of the systme at time t and consisting of a set of nodes V = Rt and a set of
edges E. Each resources is represented by a node of the directed graph. There
is a directed edge from node ri to rj if and only if there is a program pk in At that
has been allocated resource ri but is waiting for rj .
Solution 1.30. It can be shown that the state of deadlock exists in a computer
system at time t if and only if the allocation digraph Gt contains the strongly
connected components. In the case of our example. the graph Gt is strongly
connected.
References
[1] Engineering Mathematics Vol.-I and II. A.P Verma and M. N. Mehta. Stu-
dent manual SVNIT, Surat.
9
[2] Erwin Kreyszig: Advanced Engineering Mathematics, 8th edition, John
Wiley and Sons, (2008).
[3] George B. Thomas, Jr. Ross L. Finley: Calculus with analytical Geometry,
9th edition Addison-Wesley Publishing Company. (2004)
[4] Howard Anton: Calculus, A new horizon, 6th edition, John Willey and
Sons, (2006)
Acknowledgment
I am very much thankful to Prof. P. A. Gajjar, Head of the department, Nottingham
university, Kazakhstan for his valuable guidance for the preparation of this topic.
10