graph:components
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Returns the number of independent components that are in a graph.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:components in-graph)

Arg Types: in-graph graph

Returns: integer


in-graph specifies a graph.

Example: ; graph:components

; Create a simple example

(define g1 (graph "me-you us-them


we-they them-they


FIDO-SPOT SPOT-KING SPOT-PETEY"))

;; g1

; CAREFUL: The order of the graph output may

; not be the same each time.

(graph:components g1)

;; 3

(define g2 (graph:component g1 "me"))

;; g2

(define g3 (graph:component g1 "FIDO"))

;; g3

(define g4 (graph:component g1 1))

;; g4
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0034.HTM