gpt4 book ai didi

algorithm - A* 启发式实现

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:41:49 24 4
gpt4 key购买 nike

<分区>

我正在创建一个程序来以最低的成本解决这个难题

滑动标题拼图由三个黑色标题、三个白色标题和一个空白区域组成,如图所示。

WWW_BBB

The goal of the puzzle is to get all white tiles to the right of the black tiles while the location of the space does not matter

The puzzle has two legal moves(i.e. actions) with associated costs:

• A title may move into an adjacent empty location. – This has a step cost of
• A title can hop over one or two other tiles into the empty position.
– This has a step cost equal to the number of tiles jumped over.

我无法理解如何创建要在算法中实现的启发式算法。

我了解 Dijkstra 算法在这个问题中的实现,但无法弄清楚如何将其变成 A* 算法。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com