chickadee » aima » predecessor-path

predecessor-path nodeprocedure

List the predecessors of this node.

node
The node to predecess
(define (predecessor-path node)
  (let iter ((path (list node)))
    (let ((parent (node-parent (car path))))
      (if parent (iter (cons parent path)) path))))