Professional Documents
Culture Documents
Access Denied Your Page Is Blocked Due To A KIET IT Security Policy That Prohibits Access To Category Default
Access Denied Your Page Is Blocked Due To A KIET IT Security Policy That Prohibits Access To Category Default
Access Denied Your Page Is Blocked Due To A KIET IT Security Policy That Prohibits Access To Category Default
= (:
, :
+1
) in P:
Directed edge c
, :
+1
]
E.
If directed edge c
. In other words, c
=
(:
, :
+1
) and c
+1
= (:
+1
, :
+2
).
The final requirement for P to be a path in 0 is that P cannot revisit any nodes. An ordered list of
directed edges that meets the above two requirements and that does revisit nodes is called a
walk.
Examples of walks that are not paths, based on the 6-node graph drawn above:
w = ((6,4), (4,S), (S,2), (2,S), (S,4), (4,S), (S,2), (2,S), (S,1)) is a walk from node 6 to
node 1
W = ((6,4), (4,6), (6,4), (4,5), (5,1), (1,5), (5,1)) is a walk from node 6 to node 1
A walk does not have to revisit nodes. Therefore, any path by definition is also a walk.
Paths in Directed graphs
A directed path is a path in a directed graph where the directions of
edges in the path match the directions of edges in the directed graph.
For example, suppose we consider this directed graph:
The blue lines highlight P = ((6,4), (4,S), (S,1)) which is a directed
path from 6 to 1 in directed graph 0.
As a counter-example, consider the same directed graph with a
different ordered list of edges that is not a directed path:
In this case, the red lines highlight
P = ((6,4), (4,S), (S,2), (2,S), (S,1)); the 4
th
edge of P goes the
"wrong way"; and so P is not a directed path in G. We instead refer to P as an undirected path
in a directed graph.
Length
The length of a path is the number of edges that it uses.
Examples: Consider the graph in the right
The length of the red path is 5
The length of the blue path is 3
When the edges of a graph are labeled with numbers, it is called a Weighted Graph and the
length of its path is the sum of the weights of the edges.
Distance
Given a graph 0, The distance J(x, y) between two vertices x and y is the length of the shortest
path from x to y, considering all possible paths in 0 from x to y.
The distance between any node and itself is 0. If there is no path from x to y then J(x, y) is
infinity.
Example. Find the distance between b to c.
Theorems on Degrees of Vertices
Theorem 1: The Handshaking Theorem
Let 0 = (I, E) be an undirected graph with c edges. Then
2c = Jcg(:)
v
.
Example How many edges are there in a graph with 10 vertices each of degree six?
Solution: Because the sum of the degrees of the vertices is 6 10 = 60, it follows that 2c = 6u.
Therefore, c = Su.
Theorem2: An undirected graph has an even number of vertices of odd degree.
Proof: Let I
1
and I
2
be the set of vertices of even degree and the set of vertices of odd degree,
respectively, in an undirected graph 0 = (I, E). Then
2c = Jcg(:)
v
= Jcg(:)
v
1
+ Jcg(:)
v
2
Because Jcg(:) is even for : I
1
, the first term in the right-hand side of the last equality is
even. Furthermore, the sum of the two terms on the right-hand side of the last equality is even,
because this sum is 2c. Hence, the second term in the sum is also even. Because all the terms in
this sum are odd, there must be an even number of such terms. Thus, there are an even number of
vertices of odd degree.
Theorem3: Let 0 = (I , E) be a graph with directed edges. Then
Jcg
-
(:)
v
= Jcg
+
(:)
v
= |E|
Example.
Special Graphs
1. Complete Graphs. The complete graph on n vertices, denoted by K
n
, is the simple graph
that contains exactly one edge between each pair of distinct vertices. The graphs K
n
, for
n = 1, 2, S, 4, S , 6, are displayed in the figure below.
2. Cycles. The cycle C
n
, n S , consists of n vertices :
1
, :
2
, . . . , :
n
and edges {:
1
, :
2
],
{:
2
, :
3
],, {:
n-1
, :
n
], and {:
n
, :
1
]. The cycles C
3
, C
4
, C
5
, and C
6
are displayed in the
figure below.
3. Wheels. We obtain the wheel w
n
when we add an additional vertex to the cycle
C
n
, n S, and connect this new vertex to each of the n vertices C
n
, by new edges. The
wheels w
3
, w
4
, w
5
, onJ w
6
are displayed in the figure below.
4. n-Cubes. The n-dimensional hypercube, or n-cube, denoted by
n
, is the graph that has
vertices representing the 2
n
bit strings of length n . Two vertices are adjacent if and only
if the bit strings that they represent differ in exactly one bit position.
5. A simple graph 0 is called bipartite if its vertex set I can be partitioned into two disjoint
sets I
1
and I
2
such that every edge in the graph connects a vertex in I
1
and a vertex in
I
2
(so that no edge in 0 connects either two vertices in I
1
or two vertices in I
2
). When
this condition holds, we call the pair (I
1
, I
2
) a bipartition of the vertex set I of 0.
C
6
is bipartite because its vertex set can be
partitioned into the two sets
I
1
= {I
1
, I
3
, I
5
} and I
2
= {I
2
, I
4
, I
6
},
and every edge of C
6
connects a vertex in
I
1
and a vertex in I
2
.
The graph K
3
is not bipartite. To verify this, note that if we divide
the vertex set of K
3
into two disjoint sets, one of the two sets must
contain two vertices. If the graph were bipartite, these two vertices
could not be connected by an edge, but in K
3
each vertex is
connected to every other vertex by an edge.
Exercise. Are the graphs G and H displayed in Figure below bipartite?
Subgraph
A subgraph of a graph 0 = (I, E) is a graph E = (w, F), where w H I and F H E . A
subgraph E of 0 is a proper subgraph of 0 if E = 0.
Union
The union of two simple graphs 0
1
= (I
1
, E
1
) and 0
2
= (I
2
, E
2
) is the simple graph with
vertex set I
1
I
2
, and edge set E
1
E
2
. The union of 0
1
and 0
2
is denoted by 0
1
0
2
.
Example. Find the union of the graphs 0
1
and 0
2
shown in (a) below.
Solution: The vertex set of the union 0
1
0
2
is the union of the two vertex sets, namely,
{o , b , c , J, c , ]. The edge set of the union is the union of the two edge sets. The union is
displayed in (b) below.