Loading ...
Sorry, an error occurred while loading the content.

Re: alpha-beta code in chapter 5, p132

Expand Messages
  • Wheeler Ruml
    Whoops - the pseudo-code I posted didn t update alpha or beta at all! Sorry about that. Revised: Max-value (state, alpha, beta): when depth-cutoff (state),
    Message 1 of 2 , Oct 5, 2001
    • 0 Attachment
      Whoops - the pseudo-code I posted didn't update alpha or beta at
      all! Sorry about that. Revised:


      Max-value (state, alpha, beta):
      when depth-cutoff (state), return SEF(state)
      value <-- -inf
      for each child of state
      value <-- max(value, Min-value (child, alpha, beta)
      alpha <-- max(value,alpha) ;; this is the new line!
      when value > or = beta, return value
      return value


      Min-value (state, alpha, beta):
      when depth-cutoff (state), return SEF(state)
      value <-- inf
      for each child of state
      value <-- min(value, Max-value (child, alpha, beta)
      beta <-- min(value, beta) ;; this is the new line!
      when value < or = alpha, return value
      return value


      Even though this approach prunes a little less than the full
      alpha-beta code given in the book, it is much easier to explain
      (which is why it seems to be the algorithm the book is currently
      trying to explain).


      Wheeler
    Your message has been successfully submitted and would be delivered to recipients shortly.