X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=dev%2Fapi.lisp;h=fe5020c4c3f1cb9f3fe852bbb17765c45819fbdc;hb=2d52d1e533a3c73bffd2dd81620cc5bd540c314a;hp=42dac55b7cb027edd55e9bc5de52cb9d22bd0c70;hpb=438d1e0593dc62fe7b975a5865ec27955afcb7a1;p=cl-graph.git diff --git a/dev/api.lisp b/dev/api.lisp index 42dac55..fe5020c 100644 --- a/dev/api.lisp +++ b/dev/api.lisp @@ -1,4 +1,4 @@ -(in-package cl-graph) +(in-package #:cl-graph) ;;; --------------------------------------------------------------------------- @@ -14,7 +14,7 @@ ;;; API ;;; --------------------------------------------------------------------------- -(defgeneric make-graph (graph-type &key) +(defgeneric make-graph (graph-type &key &allow-other-keys) (:documentation "Create a new graph of type `graph-type'. Graph type can be a symbol naming a sub-class of basic-graph or a list. If it is a list of symbols naming different classes. If graph-type is a list, then a class which has all of the listed @@ -36,7 +36,7 @@ be created as if with a call to make-instance.")) (defgeneric add-edge-between-vertexes (graph value-or-vertex-1 value-or-vertex-2 &rest args &key if-duplicate-do - edge-type) + edge-type &allow-other-keys) (:documentation "Adds an edge between two vertexes and returns it. If force-new? is true, the edge is added even if one already exists. @@ -67,7 +67,7 @@ be called with the previous edge.")) ;;; --------------------------------------------------------------------------- -(defgeneric add-vertex (graph value-or-vertex &key if-duplicate-do) +(defgeneric add-vertex (graph value-or-vertex &key if-duplicate-do &allow-other-keys) (:documentation "Adds a vertex to a graph. If called with a vertex, then this vertex is added. If called with a value, then a new vertex is created to hold the value. If-duplicate-do can be one of :ignore, :force, :replace, :replace-value or a function. The default is :ignore.")) ;;; --------------------------------------------------------------------------- @@ -197,7 +197,9 @@ rooted at root.")) ;;; --------------------------------------------------------------------------- -(defgeneric make-filtered-graph (old-graph test-fn &optional graph-completion-method depth) +(defgeneric make-filtered-graph (old-graph test-fn &key + graph-completion-method depth + new-graph) (:documentation "Takes a GRAPH and a TEST-FN (a single argument function returning NIL or non-NIL), and filters the graph nodes according to the test-fn (those that return non-NIL are accepted), returning @@ -312,12 +314,12 @@ For more information about DOT file format, search the web for 'DOTTY' and ;;; --------------------------------------------------------------------------- -(defgeneric generate-Gnm (generator graph n m &key) +(defgeneric generate-gnm (generator graph n m &key) (:documentation "Generate a 'classic' random graph G(n, m) with n vertexes and m edges.")) ;;; --------------------------------------------------------------------------- -(defgeneric generate-Gnp (generator graph n p &key) +(defgeneric generate-gnp (generator graph n p &key) (:documentation "Generate the Erd\"os-R\'enyi random graph G\(n, p\). I.e., a graph with n vertexes where each possible edge appears with probability p. This implementation is from Efficient Generation of Large Random Networks \(see batagelj-generation-2005 in doab\).")) @@ -658,7 +660,7 @@ and any other initialization arguments that make sense for the vertex class.")) (defgeneric complete-links (new-graph old-graph) (:documentation "Add edges between vertexes in the new-graph for which the matching vertexes in the old-graph have edges. The vertex matching is done using `find-vertex`.")) -(defgeneric subgraph-containing (graph vertex &optional depth) +(defgeneric subgraph-containing (graph vertex &key) (:documentation "Returns a new graph that is a subset of `graph` that contains `vertex` and all of the other vertexes that can be reached from vertex by paths of less than or equal of length `depth`. If depth is not specified, then the entire sub-graph reachable from vertex will be returned. [?? Edge weights are always assumed to be one.]")) ;;; ---------------------------------------------------------------------------