Hello ,
Can someone help me for the bellow problem. I'm ready to pay for that.
You can get in touch with me at kalinkalchev74@gmail.com
Please help
On one side of a river, there is a boatman, a cat, a penguin, and a fish. The boatman wants to take himself and the others to the other side of the river using a boat. The boat can carry only two things at a time, one of which must be the boatman since only he can row the boat. We have the following two restrictions: If the cat and the penguin are on one side of the river and the boatman is on the other side, then the cat will eat the penguin. Similarly, if the penguin and the fish are on one side of the river and the boatman is on the other side, then the penguin will eat the fish. The goal is moving safely all four of them to the other side of the river.
a) Decide on a knowledge representation for this problem. Explain the elements used in the representation and the reasoning of using such a representation.
b) Write a Prolog program that uses depth first search for solving this problem. Note that Prolog is a depth first search engine.
c) Write a Prolog program that uses breadth first search for solving this problem. The program must not generate duplicate states. That is, a state that was generated before during the search must be discarded. Note that queue is a suitable structure for implementing breadth first search mechanism.
d) Write a Prolog program that uses best first search for solving this problem. Use two different heuristics, solve the problem with each one, and comment on their efficiency. You must take into account both the cost from the start state to the current state (i.e. the g function) and the cost from the current state to the goal state (i.e. the h function). That is, use the f?=g+h? function, not only the h? function. Experiment with different cost parameters. Typically, if each crossing of the river adds 1 to the cost, we are interested in a sequence of crossings as short as possible. Another alternative may be assigning a weight to each character for optimizing the total weight on the boat during the whole trips.
e) Change the ordering of the movement rules in the previous parts and analyze its effect on the execution of the program. For instance, what happens if the action of the boatman crossing the river alone has the highest precedence, if the action of taking the fish to the other side has higher precedence that the action of taking the cat to the other side, etc.
Can someone help me for the bellow problem. I'm ready to pay for that.
You can get in touch with me at kalinkalchev74@gmail.com
Please help
On one side of a river, there is a boatman, a cat, a penguin, and a fish. The boatman wants to take himself and the others to the other side of the river using a boat. The boat can carry only two things at a time, one of which must be the boatman since only he can row the boat. We have the following two restrictions: If the cat and the penguin are on one side of the river and the boatman is on the other side, then the cat will eat the penguin. Similarly, if the penguin and the fish are on one side of the river and the boatman is on the other side, then the penguin will eat the fish. The goal is moving safely all four of them to the other side of the river.
a) Decide on a knowledge representation for this problem. Explain the elements used in the representation and the reasoning of using such a representation.
b) Write a Prolog program that uses depth first search for solving this problem. Note that Prolog is a depth first search engine.
c) Write a Prolog program that uses breadth first search for solving this problem. The program must not generate duplicate states. That is, a state that was generated before during the search must be discarded. Note that queue is a suitable structure for implementing breadth first search mechanism.
d) Write a Prolog program that uses best first search for solving this problem. Use two different heuristics, solve the problem with each one, and comment on their efficiency. You must take into account both the cost from the start state to the current state (i.e. the g function) and the cost from the current state to the goal state (i.e. the h function). That is, use the f?=g+h? function, not only the h? function. Experiment with different cost parameters. Typically, if each crossing of the river adds 1 to the cost, we are interested in a sequence of crossings as short as possible. Another alternative may be assigning a weight to each character for optimizing the total weight on the boat during the whole trips.
e) Change the ordering of the movement rules in the previous parts and analyze its effect on the execution of the program. For instance, what happens if the action of the boatman crossing the river alone has the highest precedence, if the action of taking the fish to the other side has higher precedence that the action of taking the cat to the other side, etc.