[cl-graph-devel] map-shortest-paths questions

Robin Lee Powell rlpowell at digitalkingdom.org
Mon Sep 15 06:42:05 UTC 2008


On Sun, Sep 14, 2008 at 11:14:29PM -0700, Robin Lee Powell wrote:
> 
> So there doesn't seem to be anything like introductory
> documentation or a tutorial for cl-graph, so I'm struggling along
> trying to figure it out.
> 
> It doesn't help that it's been a decade since I needed any graph
> theory.  :D
> 
> Anyways, two questions:

Make that four.

3.  Why does map-shortests-paths appear to find paths regardless of
directed edges?  Example:

(let ((g (make-container 'graph-container :default-edge-type :directed)))
  (loop for (v1 . v2) in '((a . b) (a . c) (d . a) (e . a)) do
        (add-edge-between-vertexes g v1 v2))
  (map-shortest-paths g (find-vertex g 'a) 1 #'print))

Gives:

(#<A> #<B>)
(#<A> #<C>)
(#<A> #<D>)
(#<A> #<E>)
#<GRAPH-CONTAINER [5,4] {1002F2E641}>

The appearance of the latter two is, to put it mildly, rather
counter-intuitive to me.

4.  I apologize if this is more of a CL programming question then a
cl-graph question, but if map-shortest-paths find the path I'm
looking for, how do I make it stop looking for the rest?

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/



More information about the cl-graph-devel mailing list