# state tree for 3 water jugs problem

Page 1 of 1

## 1 Replies - 948 Views - Last Post: 12 December 2012 - 10:14 PM

### #1 Hussein40

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

# state tree for 3 water jugs problem

Posted 12 December 2012 - 10:08 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?

#### Attached File(s)

Is This A Good Question/Topic? 0

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

### #2 RozenKristal

• D.I.C Regular

Reputation: 43
• Posts: 273
• Joined: 29-September 12

## Re: state tree for 3 water jugs problem

Posted 12 December 2012 - 10:14 PM

Wow... I dont think anyone would help you out in this manner...

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }