【问题标题】:The D*-Lite algorithmD*-Lite 算法
【发布时间】:2011-08-12 08:49:15
【问题描述】:

我正在尝试实现 D*-Lite 寻路算法,如 Koenig 和 Likhachev 在 2002 article 中所述,用于 Boost::Graph。我想我已经很好地掌握了它背后的基本思想和理论,但是当PredSucc 集更新时,我在理解上遇到了问题。

我猜它发生在Main 中的Move to sstart 步骤中,但是第一次调用ComputeShortestPath 将毫无意义? Succ 集是否应该与 Pred 同时插入?那么PredSucc可以实现为双向链表吗?

我在下面插入了算法的伪代码。 PredSucc 集分别是前任和后继。 ghrhsc 是不同的成本和权重。 U 是要访问的顶点的优先级队列。

procedure CalculateKey(s)
{01’} return [min(g(s), rhs(s)) + h(sstart, s) + km; min(g(s), rhs(s))];

procedure Initialize()
{02’} U = ∅;
{03’} km = 0;
{04’} for all s ∈ S rhs(s) = g(s) = ∞;
{05’} rhs(sgoal) = 0;
{06’} U.Insert(sgoal, CalculateKey(sgoal));

procedure UpdateVertex(u)
{07’} if (u ≠ sgoal) rhs(u) = min s'∈Succ(u)(c(u, s') + g(s'));
{08’} if (u ∈ U) U.Remove(u);
{09’} if (g(u) ≠ rhs(u)) U.Insert(u, CalculateKey(u));

procedure ComputeShortestPath()
{10’} while (U.TopKey() < CalculateKey(sstart) OR rhs(sstart) ≠ g(sstart))
{11’}   kold = U.TopKey();
{12’}   u = U.Pop();
{13’}   if (kold ˙<CalculateKey(u))
{14’}     U.Insert(u, CalculateKey(u));
{15’}   else if (g(u) > rhs(u))
{16’}     g(u) = rhs(u);
{17’}     for all s ∈ Pred(u) UpdateVertex(s);
{18’}   else
{19’}     g(u) = ∞;
{20’}     for all s ∈ Pred(u) ∪ {u} UpdateVertex(s);

procedure Main()
{21’} slast = sstart;
{22’} Initialize();
{23’} ComputeShortestPath();
{24’} while (sstart ≠ sgoal)
{25’}   /* if (g(sstart) = ∞) then there is no known path */
{26’}   sstart = argmin s'∈Succ(sstart)(c(sstart, s') + g(s'));
{27’}   Move to sstart;
{28’}   Scan graph for changed edge costs;
{29’}   if any edge costs changed
{30’}     km = km + h(slast, sstart);
{31’}     slast = sstart;
{32’}     for all directed edges (u, v) with changed edge costs
{33’}       Update the edge cost c(u, v);
{34’}       UpdateVertex(u);
{35’}     ComputeShortestPath();

【问题讨论】:

    标签: algorithm path-finding d-star


    【解决方案1】:

    原来我没有对基本思想和理论有很好的掌握......我误解了“继任者”和“前任者”的含义,因为我认为它的意思是“按路径顺序”,因此在路径中,v0-&gt;v1-&gt;v2v0 将是 v1 的前身,v2 是后继者。

    然而,这只是邻居的意思。前驱集是给定顶点具有“入边”的所有顶点的集合,而后继有“出边”。

    【讨论】:

      【解决方案2】:

      阅读 LPA* 论文,您会知道它们是什么。 基本上,在 LPA* 中,搜索从起始位置开始。因此,继任者将是 u.Pop 节点周围的节点。这意味着,它们是您将从当前节点转到的节点。而Pred,简直就是一个母节点。这意味着继承者的 Pred 是 u.Pop。

      在 DLite 中,一切都相反。搜索从目标位置开始。 所以,这对你来说有点困惑。 DLite 的继任者是 LPA* 中的 Pred。所以,继任者 = U.pop。 DLite 的 Pred 是 LPA 的继任者。因此,Pred 是您将从继任者那里转到的节点。

      希望你能理解我蹩脚的英语。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-17
        • 2015-10-24
        相关资源
        最近更新 更多