Question: Please design a suitable state representation , a set of operations , and draw the complete search tree for the following problem: You are given

Please design a suitable state representation, a set of operations, and draw the complete search tree for the following problem:

You are given two water jugs, a 4-gallon jug that can hold up to 4 gallons of water and a 3-gallon jug that can hold up to 3 gallons of water. None of them has measuring markers on it.

There is a tap that can be used to fill up a jug and a sink that can be used to empty a jug. You are also allowed to fill up a jug from the other jug if the other jug has enough water. You can also empty a jug into the other jug, if the other jug has enough room.

The puzzle starts from both jugs are empty and the desired result is having exactly 2 gallons of water in the 4-gallon jug and empty in the 3-gallon jug.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!