title: Heuristic function for Water Jug
body: <p>I have a problem in Hill Climbing algorithm with Water Jug Problem :</p>
  
  <blockquote>
    <p>Given two jugs, one of which can accommodate X liters of water and the other which can accommodate Y liters of water, determine the  number of steps required to obtain exactly D liters of water in one of the jugs.</p>
  </blockquote>
  
  <p>From the start state, (X,Y) = (0,0), it can generate some states :</p>
  
  <ul>
  <li>(X,Y) = (0,Y) <br/> 
  or </li>
  <li>(X,Y) = (X,0)</li>
  </ul>
  
  <p>And from these states, it can generate others until the end state that is either (X,D) or (D,Y).</p>
  
  <p>So, Can I estimate the heuristic function for this problem? How to know which state is better than others?</p>
  
  <p>Thank you everyone.</p>