(defun tree-paths (tree) (cond ((null (cdr tree)) (list tree)) (t (mapcar #'(lambda (x) (cons (car tree) x)) (apply #'append (mapcar #'(lambda (p) (tree-paths p)) (cdr tree)))))))これを走らせると,下のようになる.
> (tree-paths *tree2*) ((s d e b a) (s d e b c) (s d e f) (s d a b e f) (s d a b c) (s a d e b c) (s a d e f) (s a b e f) (s a b e d) (s a b c)) > (tree-paths (graph-tree *graph2* 's)) ((s a d e f) (s a d e b c) (s a b e f) (s a b e d) (s a b c) (s d e f) (s d e b a) (s d e b c) (s d a b e f) (s d a b c)) > *graph2* ((f e) (e b) (e d) (d s) (d a) (c b) (b a) (a s)) > (find-all-paths *graph2* 's) ((s a d e f) (s a d e b c) (s a b e f) (s a b e d) (s a b c) (s d e f) (s d e b a) (s d e b c) (s d a b e f) (s d a b c))逆に*tree1*から*tree2*へ変換する関数を考えると,ひとつの解決方法として, pathからedge-listを作り,それをグラフとみなして,graph-treeを呼ぶとい う方法が考えられる.