```#-(and) "
P81 (**) Path from one node to another one

Write a predicate path(G,A,B,P) to find an acyclic path P from
node A to node b in the graph G. The predicate should return all
paths via backtracking.
"

(defmethod path ((g graph) src dst)
"Return a list of all the paths going from SRC to DST.
We don't include paths containing cycles, since there would be an
infinite number of them… "
(labels ((walk (path)
(mapcan (lambda (arc)
(cond
((eql (arc-to arc) dst)
(list (cons dst path)))
((member (arc-to arc) path) ; cycle
'())
(t
(walk (cons (arc-to arc) path)))))
(arcs-from-node g (first path)))))
(mapcar 'reverse (walk (list src)))))

;; (dolist (test '(
;;                 (a c (a b c))
;;                 (a c ((a b) (b c)))
;;                 (b g ((b c) (f c) (g h) d (f b) (k f) (h g)))
;;                 (s u ((s r) t (u r) (s u) (u s) (v u)))
;;                 (p m ((p q :weight 9) (m q :weight 7) k (p m :weight 5))))
;;          (terpri))
;;   (print (list test (path (make-adjacency-list-graph (third test)) (first test) (second test)))))
;;
;; ((A C (A B C)) NIL)
;; ((A C ((A B) (B C))) ((A B C)))
;; ((B G ((B C) (F C) (G H) D (F B) (K F) (H G))) NIL)
;; ((S U ((S R) T (U R) (S U) (U S) (V U))) ((S U)))
;; ((P M ((P Q :WEIGHT 9) (M Q :WEIGHT 7) K (P M :WEIGHT 5))) ((P M)))
;; NIL
;;
;;
;; (dolist (test '((a c ((a b) (b c)))
;;                 (b g ((b c) (f c) (g h) (f b) (k f) (h g)))
;;                 (s u ((s r) (u r) (s u) (u s) (v u)))
;;                 (p m ((p q :weight 9) (m q :weight 7) (p m :weight 5))))
;;          (terpri))
;;   (print (list test (path (make-edge-graph (third test)) (first test) (second test)))))
;;
;;
;; ((A C ((A B) (B C))) ((A B C)))
;; ((B G ((B C) (F C) (G H) (F B) (K F) (H G))) NIL)
;; ((S U ((S R) (U R) (S U) (U S) (V U))) ((S U) (S U) (S R U)))
;; ((P M ((P Q :WEIGHT 9) (M Q :WEIGHT 7) (P M :WEIGHT 5))) ((P M) (P Q M)))
;; NIL

;;;; THE END ;;;;```
ViewGit
{"ft_lang_label":"__label__en","ft_lang_prob":0.55250925,"math_prob":0.9920432,"size":1787,"snap":"2021-43-2021-49","text_gpt3_token_len":724,"char_repetition_ratio":0.14301738,"word_repetition_ratio":0.4010025,"special_character_ratio":0.49860102,"punctuation_ratio":0.18895966,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999709,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-26T13:01:30Z\",\"WARC-Record-ID\":\"<urn:uuid:55d57d5b-7fb2-4b3a-afe3-7e2e5dceab08>\",\"Content-Length\":\"4370\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c1f2173a-4029-45a7-805b-d3b7f6b514b6>\",\"WARC-Concurrent-To\":\"<urn:uuid:16ef6a55-40f7-40b0-b2ca-35786dc4eede>\",\"WARC-IP-Address\":\"5.9.56.230\",\"WARC-Target-URI\":\"https://git.informatimago.com/viewgit/index.php?a=viewblob&p=public/l99&h=f95379584aa8f8fde8053094a3804fe743fd8ef9&hb=752c883c88bfb5034fa7aaca549b3b074e45a0af&f=p81.lisp\",\"WARC-Payload-Digest\":\"sha1:OGJ5BMCNGPDY4PE6BNADGT7OP2BFNEMR\",\"WARC-Block-Digest\":\"sha1:OS6BFAAW33AOPFJUXAOFZ7EBEHFARFR6\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323587877.85_warc_CC-MAIN-20211026103840-20211026133840-00019.warc.gz\"}"}