Professional Documents
Culture Documents
Walk >>> A walk is an alternating sequence of vertices and edges, beginning and ending with a vertex, where each vertex is incident to both the edge that precedes it and the edge that follows it in the sequence, and where the vertices that precede and follow an edge are the end vertices of that edge. A walk is closed if its first and last vertices are the same, and open if they are different. The length l of a walk is the number of edges that it uses. For an open walk, l = n1, where n is the number of vertices visited (a vertex is counted each time it is visited). For a closed walk, l = n (the start/end vertex is listed twice, but is not counted twice). In the example graph, (1, 2, 5, 1, 2, 3) is an open walk with length 5, and (4, 5, 2, 1, 5, 4) is a closed walk of length 5. Trail >>> A trail is a walk in which all the edges are distinct. A closed trail has been called a tour or circuit, but these are not universal, and the latter is often reserved for a regular sub graph of degree two. A trail or circuit (or cycle) is Eulerian if it uses all
edges precisely once. A graph that contains an Eulerian trail is traversable. A graph that contains an Eulerian circuit is an Eulerian graph. Path >>> In graph theory, a path in a graph is a sequence of vertices such that from each of its vertices there is an edge to the next vertex in the sequence. A path may be infinite, but a finite path always has a first vertex, called its start vertex, and a last vertex, called its end vertex. Both of them are called end or terminal vertices of the path. The other vertices in the path are internal vertices. A cycle is a path such that the start vertex and end vertex are the same. Note that the choice of the start vertex in a cycle is arbitrary. Paths and cycles are fundamental concepts of graph theory, described in the introductory sections of most graph theory texts. See e.g. Bondy and Murty (1976), Gibbons (1985), or Diestel (2005). Korte et al. (1990) cover more advanced algorithmic topics concerning paths in graphs. Different types of path The same concepts apply both to undirected graphs and directed graphs, with the edges being directed from each vertex to the following one. Often the terms directed path and directed cycle are used in the directed case. A path with no repeated vertices is called a simple path, and a cycle with no repeated vertices or edges aside from the necessary repetition of the start and end vertex is a simple cycle. In modern graph theory, most often "simple" is implied; i.e., "cycle" means "simple cycle" and "path" means "simple path", but this convention is not always observed, especially in applied graph theory. Some authors (e.g. Bondy and Murty 1976) use the term "walk" for a path in which vertices or edges may be repeated, and reserve the term "path" for what is here called a simple path. A path such that no graph edges connect two nonconsecutive path vertices is called an induced path. A simple cycle that includes every vertex, without repetition, of the graph is known as a Hamiltonian cycle. A cycle with just one edge removed in the corresponding spanning tree of the original graph is known as a Fundamental
cycle. Two paths are independent (alternatively, internally vertex-disjoint) if they do not have any internal vertex in common. A path or cycle is Hamiltonian (or spanning) if it uses all vertices exactly once. A graph that contains a Hamiltonian path is traceable; and one that contains a Hamiltonian path for any given pair of (distinct) end vertices is a Hamiltonian connected graph. The length of a path is the number of edges that the path uses, counting multiple edges multiple times. The length can be zero for the case of a single vertex. A weighted graph associates a value (weight) with every edge in the graph. The weight of a path in a weighted graph is the sum of the weights of the traversed edges. Sometimes the words cost or length is used instead of weight. Circle >>> A cycle is a path that begins and ends on the same vertex. A cycle that has odd length is an odd cycle; otherwise it is an even cycle. One theorem is that a graph is bipartite if and only if it contains no odd cycles. A graph is acyclic if it contains no cycles; unicyclic if it contains exactly one cycle; and pancyclic if it contains cycles of every possible length (from 3 to the order of the graph). A graph that contains a Hamiltonian cycle is a Hamiltonian graph.
Differences between types of Graph (Walk, Trail, Path and Cycle) Walk graph Trail graph Path graph Cycle graph
A trail is a walk that does not pass over the same edge twice. A trail might visit the same vertex twice, but only if it comes and goes from a different edge each time.
A path is a walk that does not include any vertex twice, except that its first vertex might be the same as its last.
A walk is a sequence of edges in which the end of one edge except the last is the beginning of the next
A cycle is a closed path for example the end of the last edge is the start of the first.
Consider Y, a group of at least 7 towns in Malaysia. Let Y x Y be the set of all possible pairs from the set Y. a. Draw a figure showing a map of the roads connecting the towns in Y See Picture 1 & 2. b. List all of those elements Y x Y which represent direct roads ELEMENTS Tumpat Kota Bharu Ketereh Kampong Raja Jerteh Kuala Krai Tanah Merah Tumpat Kota Bharu / / / / / / / / / Ketereh / / / / / / Kampong Raja Jerteh Kuala Krai Tanah Merah / / / / /
/ /
(Tumpat, Kota Bharu) (Ketereh, Kampong Raja) (Tumpat, Ketereh) (Kota Bharu, Ketereh) (Tumpat, Tanah Merah) (Ketereh, Tanah Merah) (Kampong Raja, Jerteh) (Kampong Raja, Tanah Merah) (Jerteh, Kuala Krai) (Jerteh, Tanah Merah) (Kuala Krai, Tanah Merah)
c. Draw the graph for (b) and state the order for each vertex in the graph.
Kuala Krai
d. Give an example each for a walk, a trail, a path and a cycle based on your graph for (c)
1. A walk is a sequence of edges in which the end of one edge (except the last) is the beginning of the next. The example is ;
tumpat
kota bharu
ketereh
kampong raja
jerteh
tanah merah
kuala krai
jerteh
tanah merah
ketereh
kampong raja
tanah merah
kuala krai
jerteh
kampong raja
ketereh
kota bharu
tumpat
tanah merah
jerteh
tanah merah
tumpat
ketereh
kampong raja
jerteh
kuala krai
4. A cycle is a closed path i.e. the end of the last edge is the start of the first. Example is ;
kuala krai
jerteh
kampong raja
ketereh
tanah merah
kuala krai