A* search algorithm: Difference between revisions

Content added Content deleted
m (Correct a parenthesis in CL code)
Line 961: Line 961:
0)))
0)))
;; Check if this state was already looked at
;; Check if this state was already looked at
(unless (gethash position visited))
(unless (gethash position visited)
;; Insert the next node into the queue
;; Insert the next node into the queue
(heap-insert
(heap-insert
(node :pos position :path (cons position (node-path node))
(node :pos position :path (cons position (node-path node))
:cost cost :f-value f-value)
:cost cost :f-value f-value)
queue))))
queue)))))


;; The actual A* search
;; The actual A* search