Question
Water pouring puzzles are popular puzzles that involve a collection of water jugs, usually having the largest jug filled with water and all the other
Water pouring puzzles are popular puzzles that involve a collection of water jugs, usually having the largest jug filled with water and all the other jugs empty. The goal is to pour water from one jug to another multiple times until each jug has a specified amount of water. We assume that no water can be spilled and that it is impossible to measure any quantity of water that does not completely fill a jug. We consider a water pouring puzzle with 3 jugs of capacity 12, 7 and 5 litres, respectively: The state description specifies the amount of water in each jug, e.g., [4, 5, 3], meaning that the first jug has 4 litres, the second jug has 5 litres and the third jug has 3 litres. Actions are defined as Pour(a,b), meaning that you pour water from jug a into jug b until jug b is completely filled or jug a is empty. If jug a is empty already or jug b is full already, then action Pour(a,b) has no effect on the state. Each action Pour(a,b) has cost equal to the amount of water poured from jug a to jug b. For instance, if an action pours 3 litres from one jug to another, then the cost of that action is 3. The initial state and the goal state are [12,0,0] and [6,6,0], respectively. An illustration is shown below. The first jug is indicated by letter x, the second by letter y and the third by letter z. Therefore, action Pour(x,y) means pouring the content of jug x into jug y either until x is empty or until y is full as explained above. Instructions. In creating your search tree you must make the following assumptions: When choosing which node to expand, always proceed in the order corresponding to pouring water from x to y, then from x to z, then from y to x, then from y to z, then from z to x and finally from z to y. DO NOT add a node if the node is in the list of visited nodes or is in the frontier. Nodes are identified by the integers corresponding to the amount of water in each jug. For instance, the state [3,4,5] is identified by '345'. Generate the breadth-first tree until the goal node is found. Write down the solution to the search problem by specifying ONLY the jugs used in each action, separated by a comma without spaces. For example, if the solution is "Pour(x,y), Pour(y,z), Pour(z,x)", then write xy,yz,zx in the input box for this question.
What is the cost of the solution obtained from Question 1?
What is the path from the initial state to the goal state found by BFS? Follow the instructions above to enter the list of nodes in the path, separated by commas without spaces: for example, if the path contains states [12,0,0] and [7,0,5], then your solution to this question will be: 1200,705.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started