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

Action: Returns whether or not two vertices in a graph are connected with an edge.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:adjacent in-graph vertex1 vertex2)

Arg Types: in-graph graph

vertex1 string | entity

vertex2 string | entity

Returns: boolean


in-graph specifies a graph.


The vertex1 and vertex2 elements are required to be part of the in-graph. They could be either entities or their designation as part of the in-graph.

Example: ; graph:adjacent

; 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:adjacent g1 "we" "FIDO")

;; #f

(graph:adjacent g1 "we" "they")

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