# 数学代写|图论作业代写Graph Theory代考|Rooted Trees

## 数学代写|图论作业代写Graph Theory代考|Rooted Trees

When we look at the graph theory terminology used for trees, mathematicians have adopted many of the same terms that we use for biological trees (such as leaf and forest). So what then would we mean by a root of a tree? We can think of the root as the place from which a tree grows.

Definition 3.15 A rooted tree is a tree $T$ with a special designated vertex $r$, called the root. The level of any vertex in $T$ is defined as the length of its shortest path to $r$. The height of a rooted tree is the largest level for any vertex in $T$.

Example 3.6 Find the level of each vertex and the height of the rooted tree shown below.

Solution: Vertices $a$ and $b$ are of level $1, c, d, e$, and $f$ of level 2 , and $g$ and $h$ of level 3 . The root $r$ has level 0 . The height of the tree is 3 .

Most people have encountered a specific type of rooted tree: a family tree. In fact, much of the terminology for rooted trees comes not from a plant version of a tree but rather from genealogy and family trees. The root of a family tree would be the person for whom the descendants are being mapped and the level of a vertex would represent a generation; see the tree below. With this application in mind, the terminology below is used to describe how various vertices are related within a rooted tree.

## 数学代写|图论作业代写Graph Theory代考|Depth-First Search Tree

The main idea behind a depth-first tree is to travel along a path as far as possible from the root of a given graph. If this path does not encompass the entire graph, then branches are built off this central path to create a tree. The formal description of this algorithm relies on an ordered listing of the neighbors of each vertex and uses this order when adding new vertices to the tree. For simplicity, we will always use an alphabetical order when considering neighbor lists.
Depth-First Search Tree
Input: Simple graph $G=(V, E)$ and a designated root vertex $r$.
Steps:

1. Choose the first neighbor $x$ of $r$ in $G$ and add it to $T=\left(V, E^{\prime}\right)$.
2. Choose the first neighbor of $x$ and add it to $T$. Continue in this fashion-picking the first neighbor of the previous vertex to create a path $P$. If $P$ contains all the vertices of $G$, then $P$ is the depth-first search tree. Otherwise continue to Step (3).
1. Backtrack along $P$ until the first vertex is found that has neighbors $\operatorname{not}$ in $T$. Use this as the root and return to Step (1).
Output: Depth-first search tree $T$.
In creating a depth-first search tree, we begin by building a central spine from which all branches originate. These branches are as far down on this path as possible. In doing so, the resulting rooted tree is often of large height and is more likely to have more vertices at the lower levels.

# 图论代考

## 数学代写|图论作业代写Graph Theory代考|Rooted Trees

Example 3.6 找到每个顶点的层数和下图所示的有根树的高度。

## 数学代写|图论作业代写Graph Theory代考|Depth-First Search Tree

1. 选择第一个邻居 $x$ 的 $r$ 在 $G$ 并将其添加到 $T=\left(V, E^{\prime}\right)$.
2. 选择的第一个邻居 $x$ 并将其添加到 $T$. 继续这种方式一选择前一个顶点的第一个邻居 来创建路径 $P$. 如果 $P$ 包含的所有顶点 $G$ ，然后 $P$ 是深度优先搜索树。否则继续步骤 (3) 。
3. 原路返回 $P$ 直到找到第一个有邻居的顶点not在 $T$. 以此为根，返回步骤 (1)。
输出：深度优先搜索树 $T$.
在创建深度优先搜索树时，我们首先构建一个中心脊柱，所有分支都起源于该中心脊 柱。这些分支在这条路径上尽可能远。这样做时，生成的有根树通常高度很高，并且 更可能在较低级别具有更多顶点。

myassignments-help数学代考价格说明

1、客户需提供物理代考的网址，相关账户，以及课程名称，Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明，让您清楚的知道您的钱花在什么地方。

2、数学代写一般每篇报价约为600—1000rmb，费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵)，报价后价格觉得合适，可以先付一周的款，我们帮你试做，满意后再继续，遇到Fail全额退款。

3、myassignments-help公司所有MATH作业代写服务支持付半款，全款，周付款，周付款一方面方便大家查阅自己的分数，一方面也方便大家资金周转，注意:每周固定周一时先预付下周的定金，不付定金不予继续做。物理代写一次性付清打9.5折。

Math作业代写、数学代写常见问题

myassignments-help擅长领域包含但不是全部: