【发布时间】:2015-07-03 19:14:01
【问题描述】:
我有一个迷宫(以二维矩阵表示),如下所示 (5 x 5):
s 1 X 1 X
1 X 1 1 1
1 1 X 1 X
X 1 G 1 X
1 1 1 1 1
其中 s 是起始位置,G 是目标位置,X 是障碍物。
如何在迷宫中使用最小冲突启发法应用本地搜索。
我在想的是使用障碍作为“冲突”和
1. Start at the starting position, current = start;
2. Find the neighbor that has least number of neighboring obstacles (conflicts),
3. Update current to that neighbor state, and
4. Repeat until goal is found.
为简单起见,我只能向左、向右、向上或向下移动;但没有对角线
我做得对吗?如果这里有人可以为我指出正确的方向,那就太好了。
【问题讨论】:
标签: java search artificial-intelligence maze