1 Replies - 997 Views - Last Post: 12 December 2012 - 10:13 PM

#1 Hussein40  Icon User is offline

  • New D.I.C Head

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

state tree for 3 water jugs problem

Posted 12 December 2012 - 10:10 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:
add is: [x,y,z]

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 BenignDesign  Icon User is offline

  • holy shitin shishkebobs
  • member icon




Reputation: 6180
  • View blog
  • Posts: 10,683
  • Joined: 28-September 07

Re: state tree for 3 water jugs problem

Posted 12 December 2012 - 10:13 PM

Duplicate thread. Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1