August 21, 2024
P82 - Cycle from a given node
Write a function (cycle g a) to find a closed path (cycle) starting at a given node a in the graph g. The function should return all cycles.
lisp
;;; Depende se o ciclo e' orientado ou nao
;;; Em ambos os casos, creio que nao se deve
;;; repetir arestas nem vertices intermediarios
(defun cycle (g a)
"It depends on whether we are given a directed or undirected graph.
Moreover, I think that directed cycles must have at least one edge, and
undirected ones must have at least three edges. In both cases, I think
one should not repeat intermediate vertices."
)