rebuilding repo
[cl-graph.git] / dev / notes.text
1 (in-package metabang.graph)
2
3 (in-package cl-graph)
4 (defun is-connected-p (g)
5   (let ((count 0))
6     (cl-graph::breadth-first-visitor g (first-item g) (lambda (v)
7                                                         (declare (ignore v))
8                                                         (incf count)))
9     (= count (size g))))
10
11 (let ((g (make-container 'graph-container))
12       ) 
13   (loop for v in '(a b c d e) do
14         (add-vertex g v))
15   (loop for (v1 . v2) in '((a . b) (a . c) (b . d) (c . e)) do
16         (add-edge-between-vertexes g v1 v2))
17   g
18   (is-connected-p g))
19
20 (let ((g (make-container 'graph-container))
21       ) 
22   (loop for v in '(a b c d e) do
23         (add-vertex g v))
24   (loop for (v1 . v2) in '((a . b) (a . c) (b . d)) do
25         (add-edge-between-vertexes g v1 v2))
26   g
27   (is-connected-p g))
28
29
30
31 #|
32 searching functions
33 |#
34
35 #|
36 nearest-common-descendent
37 adjacentp 
38 adjacentp*
39 all-next-vertexes
40 all-next-vertexes*
41 all-previous-vertexes
42 all-previous-vertexes*
43 |#
44
45 add-edge doesn't use force-new? or other args
46
47 I'd like to be able to (setf (edges g a b) c) or something
48
49 pull id-pools from AFS to use for graph and edge id's
50
51
52 ;;; ---------------------------------------------------------------------------
53
54 ok - do vertexes know their graph? edges their vertexes?
55 ok - edges can be defined 'generically'
56 ok - in-undirected-cycle-p uses loop instead of iterate-vertexes
57