1 The only reasons we rely on cl-mathstats are
3 ; /Users/gwking/.fasls/allegro-8.0m-macosx-x86/Users/gwking/darcs/cl-graph/dev/graphviz/graphviz-support.fasl
4 Warning: While compiling these undefined functions were referenced:
5 cl-graph::matrix-trace from position 7424 in
6 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
7 cl-graph::matrix-multiply from position 7424 in
8 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp, 7827 in
9 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
10 cl-graph::normalize-matrix from position 7424 in
11 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
13 ;;; move to l0-arrays? or metatilities?
14 cl-graph:: sum-of-array-elements from position 7424 in
15 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp, 7827 in
16 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
17 cl-graph::combination-count from position 5742 in
18 /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
20 some other things might be +e+, degrees->radians and radians->degrees,
21 combination-count, permutation-count, sum-of-array-elements
24 - Use samep in samep for associative containers
26 optimize : find-edge-between-vertexes-if
27 (defmethod find-edge-between-vertexes-if ((graph graph-container)
28 (vertex-1 graph-container-vertex)
31 &key error-if-not-found?)
32 (let ((v2 (find-vertex graph value-2 error-if-not-found?)))
34 (find-edge-between-vertexes-if
36 :error-if-not-found? error-if-not-found?))))
38 ;;; ---------------------------------------------------------------------------
40 (defmethod find-edge-between-vertexes-if ((graph graph-container)
42 (vertex-2 graph-container-vertex)
44 &key error-if-not-found?)
45 (let ((v1 (find-vertex graph value-1 error-if-not-found?)))
47 (find-edge-between-vertexes-if
49 :error-if-not-found? error-if-not-found?))))
52 Hmm, should probably write a macro that created all four method [ (t t), (t vertex), (vertex t) and (vertex vertex)] magically...
55 Should have delete-item-at-1
57 delete-edge : equal or eql
63 (let ((g (make-instance 'graph-container
64 :default-edge-type :directed)))
65 (add-edge-between-vertexes g :a :b)
66 (add-edge-between-vertexes g :a :c)
67 (add-edge-between-vertexes g :b :d)
81 #<GRAPH-CONTAINER 4 #x17D9B526>
83 (defclass* weighted-directed-edge (directed-edge-mixin weighted-edge)
86 (let ((g (make-instance 'graph-container
87 :default-edge-class 'weighted-directed-edge)))
88 (add-edge-between-vertexes g :a :b)
89 (add-edge-between-vertexes g :a :c)
90 (add-edge-between-vertexes g :b :d :weight 2.5)
93 (lambda (e s) (format s "weight=~D" (weight e)))))
107 #<GRAPH-CONTAINER 4 #x17DAFE36>
110 (defun weighted-sum-of-connected-vertexes (vertex)
112 (iterate-target-edges
115 (incf sum (* (weight e) (element (other-vertex e vertex))))))
122 (in-package metabang.graph)
124 (in-package cl-graph)
125 (defun is-connected-p (g)
127 (cl-graph::breadth-first-visitor g (first-item g) (lambda (v)
132 (let ((g (make-container 'graph-container))
134 (loop for v in '(a b c d e) do
136 (loop for (v1 . v2) in '((a . b) (a . c) (b . d) (c . e)) do
137 (add-edge-between-vertexes g v1 v2))
141 (let ((g (make-container 'graph-container))
143 (loop for v in '(a b c d e) do
145 (loop for (v1 . v2) in '((a . b) (a . c) (b . d)) do
146 (add-edge-between-vertexes g v1 v2))
157 nearest-common-descendent
162 all-previous-vertexes
163 all-previous-vertexes*
166 add-edge doesn't use force-new? or other args
168 I'd like to be able to (setf (edges g a b) c) or something
170 pull id-pools from AFS to use for graph and edge id's
173 ;;; ---------------------------------------------------------------------------
175 ok - do vertexes know their graph? edges their vertexes?
176 ok - edges can be defined 'generically'
177 ok - in-undirected-cycle-p uses loop instead of iterate-vertexes