A * VS树最长路径 [英] A* vs trees in longest path

查看:183
本文介绍了A * VS树最长路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让T为其中每个节点重新presents的状态的树。根重presents初始状态。一个边缘从父到子去指定可在父,以改变的状态下进行的操作(新的状态将是孩子)。每个边缘与一个相关联的增益,即我收获通过从父状态转变到所述子状态。

Let T be a tree in which each node represents a state. The root represents the initial state. An edge going from a parent to a child specifies an action that can be performed on the parent in order to change state (the new state will be the child). Each edge is associated with a gain, i.e., I gain something by transitioning from the parent state to the child state.

此外,假设从根到叶节点的每条路径的长度是问:

Moreover, suppose that each path from the root to a leaf node has length Q.

我的目标是寻找长度为Q,即最有希望的路径中的一个,从而保证最大增益(其中的路径增益被定义为附加到边缘的路径增益的总和)的路径。

My objective is the one of finding the most promising path of length Q, i.e., the path that guarantees the largest gain (where the path gain is defined as the summation of the gains attached to the edges in the path).

很明显,我想这样做没有探索整个树,因为T可能是非常巨大的。

Obviously, I would like to do this without exploring the entire tree, since T could be very huge.

因此​​,我曾考虑过将A *。我知道,A *,可用于查找在图中的最短路径,但是:

Thus, I thought about applying A*. I know that A* can be used to find the shortest path in a graph, but:

  • 在我没有成本的,我有收获
  • 我想找到的最长路径(实际上不是最长的从起始节点的距离,但一来它们的权重,如果概括起来,给予最高值)
  • 在我有一棵树,而不是一个图(无周期!)

最后,我想出了一组问题,我想会对你:

Eventually, I came up with a set of question that I would like to pose to you:

  1. 是*适合这种类型的问题?我会找到最佳的解决方案应用呢?
  2. 由于A *需要使用成本的(下)估计从当前节点到目标的情况下,最短路径,我是否需要寻求增益的(以上)的估计从当前节点到目标,并把它作为一种启发式的?
  3. 在给定一个节点n T,我的想法是计算启发式H(N)由n个孩子,这可能不是那么紧取得的成果的总和。你认为有可能是一个更好的解决方案?

编辑:给定一个节点n的树中,附着于边缘传出从n不能大于一个量U(n)的增益。而且,U(n)的变小,作为n的增加的深度。

given a node n in the tree, the gain attached to an edge outgoing from n cannot be greater than a quantity U(n). Moreover, U(n) becomes smaller and smaller as the depth of n increases.

推荐答案

的原因是如下。假设你断言路径 P 是最优的,并没有检查边电子。我可以,不失一般性,设置电子来的值​​大于所有其他收益在树的总和的增益。然后,你的路径 P 不可以最优的。

Analysis

The reason is as follows. Suppose you assert that a path P is optimal, and have not examined edge e. I can, without loss of generality, set the gain for e to a value greater than the sum of all other gains in the tree. Then your path P is not optimal.

所以,最优的检查所有边缘涨幅前作出的任何论断是错误的。

So any assertion of optimality made before examining all edges' gains is false.

如果没有附加信息给出关于边收益,您不能找到最优路径,而不探索整个树

If no additional information is given about the gains on edges, you cannot find the optimal path without exploring the entire tree.

如果你有,例如,上限增益值,你可以使用*来更有效地找到最佳路径,而不是检查每一个角落。

If you had, for example, an upper bound on gain values, you could use A* to more-efficiently find the optimal path and not examine every edge.

回应你的问题做出这个答案写后的变化是在下面的评论。请务必对其进行审查。

这篇关于A * VS树最长路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆