|#
(in-package #:metabang.graph)
+(eval-always
+ (import '(cl-mathstats:matrix-trace
+ cl-mathstats:sum-of-array-elements
+ cl-mathstats:matrix-multiply
+ cl-mathstats:normalize-matrix
+ cl-mathstats:combination-count
+ )))
(defun vertex-degree-counts (g)
"Returns an associative-container mapping edge-counts to the number of vertexes with that edge-count."
&key (edge-size (constantly 1)))
"Prints a summary of vertex degrees in `graph` to standard-out. Both the average degree of all vertexes and the average degree between all pairs of vertex classes \(as determined by the vertex-classifier\) will be printed. The `edge-size` parameter is passed on to `vertex-degree` to allow for weighted edges."
- (bind ((counts (node-counts graph :key vertex-classifier))
+ (let ((counts (node-counts graph :key vertex-classifier))
(kinds (collect-elements counts :transform #'first)))
(format t "~%Vertex counts: ")
(loop for (kind count) in counts do