O'Reilly logo

Land of Lisp by Conrad Barski M.D.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Undirected Graphs

A graph that has arrows on its edges is called a directed graph:

image with no caption

But sometimes we have data that is undirected, allowing us to travel in both directions along an edge. Such a graph is less busy than a directed graph, and can be easier to understand:

image with no caption

The following code expands our graph utilities with new functions that let us draw undirected graphs:

(defun uedges->dot (edges)
   (maplist (lambda (lst)
               (mapc (lambda (edge)
 (unless ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required