# state tree for 3 water jugs problem

Page 1 of 1

## 1 Replies - 1041 Views - Last Post: 12 December 2012 - 10:09 PM

### #1 Hussein40

• New D.I.C Head

Reputation: 0
• Posts: 3
• Joined: 12-December 12

# state tree for 3 water jugs problem

Posted 12 December 2012 - 10:07 PM

we have 3 jugs with 12,8,3 at the first time the jugs are
(0,0,0)
we can fill them, pour a jug in other jugs and empty jug.
we want to have the only one liter in jugs.
the initial state is: (0,0,0)
the successor function is:

fill is: [12,x,y],[x,8,z],[x,y,3]
empty is:
[0,y,z],[x,0,z],[x,y,0]

so i think i have problem with its tree. i want to draw its tree but i'm not sure it is right or not:
the tree is:

(0,0,0)
/ | \
(12,0,0) (0,8,0) (0,0,3)

now the child for(12,0,0)is:
(12,0,0),(12,8,0),(12,8,3),(0,8,3),(0,0,3),(0,0,0),(9,8,3),(12,8,0),(4,8,3),(12,0,3),(12,5,3),(12,5,3),(12,8,0)
fail node is:(12,0,0),(0,0,0)==>because it is in root,(12,8,0)==>cause same,
-----------------------
the child for the node (0,0,3):
(3,0,0),(0,3,0),(0,0,3),(1,1,1)
(1,1,1) is the goal state am i right?
i attached a file that could help to find out about what i want to do?

Is This A Good Question/Topic? 0

## Replies To: state tree for 3 water jugs problem

### #2 modi123_1

• Suitor #2

Reputation: 10606
• Posts: 41,154
• Joined: 12-June 08

## Re: state tree for 3 water jugs problem

Posted 12 December 2012 - 10:09 PM

Closing duplicate topic. Do not open so many.