From 566a86f255415e37fede15b80cb07d77c8947741 Mon Sep 17 00:00:00 2001 From: Mason Smith Date: Thu, 13 Jan 2011 14:11:19 -0800 Subject: [PATCH 1/2] Added WEIGHT method that specializes on weighted-edge-mixin --- dev/graph.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/graph.lisp b/dev/graph.lisp index 60864ff..bbfc807 100644 --- a/dev/graph.lisp +++ b/dev/graph.lisp @@ -130,7 +130,8 @@ something is putting something on the vertexes plist's (defmethod weight ((edge basic-edge)) (values 1.0)) - +(defmethod weight ((edge weighted-edge-mixin)) + (slot-value edge 'weight)) (defclass* basic-graph () ((graph-vertexes :unbound ir) From f109546393792e7e454ceaf4232dc025e53cfbd3 Mon Sep 17 00:00:00 2001 From: Mason Smith Date: Sat, 15 Jan 2011 20:22:17 -0800 Subject: [PATCH 2/2] Fixed bug in rootp --- dev/graph.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/graph.lisp b/dev/graph.lisp index bbfc807..a4d49e2 100644 --- a/dev/graph.lisp +++ b/dev/graph.lisp @@ -644,7 +644,7 @@ something is putting something on the vertexes plist's (defmethod rootp ((vertex basic-vertex)) ;;?? this is inefficient in the same way that (zerop (length )) is... - (zerop (source-edge-count vertex))) + (zerop (target-edge-count vertex))) (defmethod find-vertex-if ((graph basic-graph) fn &key key)