Home / Expert Answers / Advanced Math / asap-the-subgraph-of-g-obtained-by-adding-the-vertex-y-and-the-edge-xy-to-t-is-again-a-tree-in-pa874

(Solved): Asap the subgraph of G obtained by adding the vertex y and the edge xy to T is again a tree in ...



Asap

the subgraph of \( G \) obtained by adding the vertex \( y \) and the edge \( x y \) to \( T \) is again a tree in \( G \) (s 11: \( \quad \) set \( p(y):=x, \ell(y):=\ell(x)+1 \) and \( t(y):=i \)
12: append \( y \) to \( Q \)
13: else
14: remove \( \( (0) \)
Fig. 6.3. (a) A depth-first search tree of a connected graph, and (b) another drawing of this tree
\[
\begin{aligne
the subgraph of obtained by adding the vertex and the edge to is again a tree in (see Figure 6.1). Fig. 6.1. Growing a tree in a graph Using the above idea, one may generate a sequence of rooted trees in , starting with the trivial tree consisting of a single root vertex , and terminating either with a spanning tree of the graph or with a nonspanning tree whose associated edge cut is empty. (In practice, this involves scanning the adjacency lists of the vertices already in the tree, one by one, to determine which vertex and edge to add to the tree.) We refer to such a procedure as a tree-search and the resulting tree as a search tree. If our objective is just to determine whether a graph is connected, any treesearch will do. In other words, the order in which the adjacency lists are considered is immaterial. However, tree-searches in which specific criteria are used to determine this order can provide additional information on the structure of the graph. For example, a tree-search known as breadth-first search may be used to find the distances in a graph, and another, depth-first search, to find the cut vertices of a graph. The following terminology is useful in describing the properties of search trees. Recall that an -tree is a tree with root . Let be such a tree. The level of a vertex in is the length of the path . Each edge of joins vertices on consecutive levels, and it is convenient to think of these edges as being oriented from the lower to the higher level, so as to form a branching. Several other terms customarily used in the study of rooted trees are borrowed from genealogy. For instance, each vertex on the path , including the vertex itself, is called an ancestor of , and each vertex of which is an ancestor is a descendant of . An ancestor or descendant of a vertex is proper if it is not the vertex itself. Two vertices are related in if one is an ancestor of the other. The immediate proper ancestor of a vertex other than the root is its predecessor or parent, denoted , and the vertices whose predecessor is are its successors or children. Note that the (oriented) edge set of a rooted tree is determined by its predecessor function , and conversely 11: set and 12: append to 13: else 14: remove from 15: end if 16: end while 17: return The spanning tree returned by BFS is called a breadth-first search tree, or BFS-tree, of G. An example of a BFS-tree in a connected graph is shown in Figure 6.2. The labels of the vertices in Figure indicate the times at which they were added to the tree. The distance function is shown in Figure . The evolution of the queue is as follows, the vertices being indicated by their times. (0) Fig. 6.2. A breadth-first search tree in a connected graph: (a) the time function , and (b) the level function BFS-trees have two basic properties, the first of which justifies our referring to as a level function. Fig. 6.3. (a) A depth-first search tree of a connected graph, and (b) another drawing of this tree The following proposition provides a link between the input graph , its DFStree , and the two time functions and returned by DFS. Proposition Let and be two vertices of , with . a) If and are adjacent in , then . b) is an ancestor of in if and only if .


We have an Answer from Expert

View Expert Answer

Expert Answer


Proposition 6.5 :) Let u and v be two vertices of G, with f(u)If uandv are adjacent in G, then l(v)u is an ancestor of v in T if and
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe