## 星期四, 4月 02, 2009

### 試試

 1 Add START to OPEN list 2     while OPEN not empty 3         get node n from OPEN that has the lowest f(n) 4         if n is GOAL then return path 5         move n to CLOSED 6         for each n’ = CanMove(n , direction) 7             g(n’) = g(n) + cost(n,n’) 8             calculate f(n’)=g(n’)+h(n’) 9             if n’ in OPEN list and new n’ is not better , continue10             if n’ in CLOSED list and new n’ is not better , continue11             remove any n’ from OPEN and CLOSED12             add n as n’s parent13             add n’ to OPEN ….. coming up in OPEN14         end for15     end while16 if we get here , then there is No Solution

---