简体   繁体   中英

Finding a heuristic missionary and cannibals

I am trying to build aa* algorithm that will solve a missionary and cannibals problem. I am unsure of the heuristic I should use and what I should possibly look for to try and end up solving this.

This is the requirements and the way that you can move.

Four missionaries and four cannibals are on West bank (W) of a river, along with a boat that can hold up to three people: 0 < capacity of boat ≤ 3. Find a way to get everyone to East bank (E) without ever leaving a group of missionaries in one place outnumbered by the cannibals in that place. This problem is famous in AI because it was the subject of the 1st paper that approached problem formulation from an analytical viewpoint (Amerel, 1968).

This particular state space is small enough that you can explore it with breadth first search.

In general, however, one fruitful source of heuristics is to drop one or more of the constraints that make the problem difficult, thereby "relaxing" the problem (that's a technical term). Figuring out which ones is an art, unfortunately. For this particular problem, you could drop the constraint that the cannibals not outnumber the missionaries, thereby making the heuristic value a simple function of where the boat is and how many people are on each side of the river.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM