A walk can be defined as a sequence of edges and vertices of a graph. When we have a graph and traverse it, then that traverse will be known as a walk. In a walk, there can be repeated edges and vertices. The number of edges which is covered in a walk will be known as the Length of the walk. In a graph, there can be more than one walk.
So for a walk, the following two points are important, which are described as follows:
For example: In this example, we have a graph, which is described as follows:
In the above graph, there can be many walks, but some of them are described as follows:
1. A, B, C, E, D (Number of length = 4)
2. D, B, A, C, E, D, C (Number of length = 7)
3. E, C, B, A, C, E, D (Number of length = 6)
There are two types of the walk, which are described as follows:
1. Open Walk
A walk will be known as an open walk in the graph theory if the vertices at which the walk starts and ends are different. That means for an open walk, the starting vertex and ending vertex must be different. In an open walk, the length of the walk must be more than 0.
2. Closed Walk
A walk will be known as a closed walk in the graph theory if the vertices at which the walk starts and ends are identical. That means for a closed walk, the starting vertex and ending vertex must be the same. In a closed walk, the length of the walk must be more than 0.
Note: There are some important points which we should learn:
Suppose there is a graph, which is described as follows:
In this graph, there is also a closed walk and an open walk, which are described as follows:
A trail can be described as an open walk where no edge is allowed to repeat. In the trails, the vertex can be repeated.
So for a trail, the following point is important, which is described as follows:
In the above graph, there is a tail and closed tail, which is described as follows:
A circuit can be described as a closed walk where no edge is allowed to repeat. In the circuit, the vertex can be repeated. A closed trail in the graph theory is also known as a circuit.
So for a circuit, the following two points are important, which are described as follows:
In the above graph, there is a circuit, which is described as follows:
Circuit: A, B, D, C, F, H, C, A
A closed path in the graph theory is also known as a Cycle. A cycle is a type of closed walk where neither edges nor vertices are allowed to repeat. There is a possibility that only the starting vertex and ending vertex are the same in a cycle.
So for a cycle, the following two points are important, which are described as follows:
In the above graph, there is a cycle, which is described as follows:
Cycle: A, B, D, C, A
A path is a type of open walk where neither edges nor vertices are allowed to repeat. There is a possibility that only the starting vertex and ending vertex are the same in a path. In an open walk, the length of the walk must be more than 0.
So for a path, the following two points are important, which are described as follows:
In the above graph, there is a path, which is described as follows:
Path: F, H, C, A, B, D
Note: There are some important points which we should learn:
The above definitions can be easily remembered with the help of following chart:
There are various examples of the walk, which are described as follows:
Example 1: In this example, we will consider a graph.
Now we have to find out which sequence of the vertices determines walks. The sequence is described below:
For those sequences which are walk, we have to also determine whether it is a cycle, path, circuit, or trail.
In the above graph, A, B, C, D, E, F, and G are the vertices, and the line between two vertices is the edges, i.e., the line between A and B is an edge. To solve this, we will first determine sequence no 1. After that, we will proceed to the next.
- Sequence no 1 is a Trail because there is no repeated edge in the sequence ABGFCB.
- Sequence no 2 is a Walk because the sequence BGFCBGA contains the repeated edges and vertices.
- Sequence 3 is a Cycle because the sequence CEFC does not contain any repeated vertex or edge except the starting vertex C.
- Sequence no 4 is a Walk because the sequence CEFCE contains the repeated edges and vertices.
- Sequence no 5 is Not a Walk because there is no direct path to go from B to F. That's why we can say that the sequence ABFA is not a Walk.
- Sequence no 6 is a Path because the sequence FDECB does not contain any repeated edges and vertices.
Example 2: In this example, we will consider a graph.
With the help of below sequences, we have to determine the nature of walk in each case:
In the above graph, v1, v2, v3, v4, v5, v6 are the vertices and e1, e2, e3, e4, e5, e6, e7 are the edges. To solve this, we will first determine sequence no 1. After that, we will proceed to the next.
- Sequence no 1 is an Open Walk because the starting vertex and the last vertex are not the same. The starting vertex is v1, and the last vertex is v2.
- Sequence no 2 does not have a path. It is a trail because the trail can contain the repeated edges and vertices, and the sequence v4v1v2v3v4v5 contains the repeated vertex v4.
- Sequence no 3 is a Path because the sequence v1e1, v2e2, v3e3, v4e4, and v5 does not contain any repeated edges and vertices.
- Sequence no 4 is a Cycle because the sequence v1e1, v2e2, v3e3, v4e7, v1 does not contain any repeated vertex or edge except the starting vertex v1.
- Sequence no 5 does not have a cycle. It is a Circuit because a circuit can contain the repeated vertex, but it cannot contain repeated edges except the starting vertex. The sequence v6e5, v5e4, v4e3, v3e2, v2e1, v1e7, v4e6, v6 contains the repeated vertex v4.
Example 3: In this example, we will consider a graph.
The sequence related to the above graph is described as follows:
Now we have to determine various the answers to various questions, which are described as follows:
Here we will solve the first question and find out which sequences are directed walks. After that, we will proceed to the next one.
Part 1
- Here sequences no 1 and 2 are the directed walks because the directed walk can contain repeated vertices and edges.
- Sequence no 2 is not a directed walk because the sequence DABED does not contain any edge between A and B.
- Sequence no 3 is also not a directed walk because the sequence DBECBAD does not contain any edge between B and A.
Part 2
- With the help of above part, we can say that sequences no 1 and 2 are the directed graph. So we can only find the length of sequences 1 and 2. The length of the directed walks 1 and 2 are 4.
Part 3
- Sequences no 3 and 4 are not the directed walk, so we will only find whether sequences 1 and 2 are the directed path.
- Sequences no 1 and 2 are not the directed paths because both sequences contain the repeated vertex. Sequence no 1 contains the repeated vertex B, and sequence no 2 contains the repeated vertex A.
Part 4
- Sequences no 1 and 2 do not contain the directed cycle because the cycle does not contain repeated vertices and edges. Sequence no 1 contains the repeated vertex B, and sequence no 2 contains the repeated vertex A.
65 videos|120 docs|94 tests
|
|
Explore Courses for Civil Engineering (CE) exam
|