graph:connected?
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Determines whether or not the specified graph is connected, or all in one component.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:connected? in-graph)

Arg Types: in-graph graph

Returns: boolean


in-graph specifies a graph.

Example: ; graph:connected?

; 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:connected? g1)

;; #f

(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

(graph:connected? g4)

;; #t
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0035.HTM