How to solve "Water Jug" Problem
In the water jug problem in Artificial Intelligence , we are provided with two jugs: one having the capacity to hold 3 liter of water and the other has the capacity to hold 4 liter of water. There is no other measuring equipment available and the jugs also do not have any kind of marking on them. So, the agent’s task here is to fill the 4-gallon jug with 2 gallons of water by using only these two jugs and no other material. Initially, both our jugs are empty. So, to solve this problem, following set of rules were proposed: Production rules for solving the water jug problem Here, let x denote the 4-gallon jug and y denote the 3-gallon jug. S.No. Initial State Condition Final state Description of action taken 1. (x,y) If x<4 (4,y) Fill the 4 liter jug completely 2. (x,y) if y<3 (x,3) Fill the 3 liter jug completely 3. (x,y) If x>0 (x-d,y) Pour some part from the 4 liter jug 4. (x,y) If y>0 (x,y-d) Pour some part from the 3 li...