graph:cycle-vertex?
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Determines whether or not a given vertex is a cycle vertex.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:cycle-vertex? in-graph in-vertex)

Arg Types: in-graph graph

in-vertex string | entity

Returns: boolean

Description: A cycle is defined as a connected group of vertices whose individual removal from the graph results in a linear graph and the same number of components. In other words, none of the vertices of the cycle are cut vertices and none have edges to more than one vertex.


in-graph specifies a graph.


in-vertex could be the designated name string within the graph or the model entity associated with the graph vertex.

Example: ; graph:cycle-vertex?

; Create a simple example

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


them-they me-they


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

;; g1

; CAREFUL: The order of the graph output may

; not be the same each time.

(graph:cycle? g1)

;; #f

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

;; g2

(graph:cycle? g2)

;; #f

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

;; g3

(graph:cycle? g3)

;; #t

(graph:cycle-vertex? g1 "FIDO")

;; #f

(graph:cycle-vertex? g1 "me")

;; #t

(graph:cycle-vertex? g3 "me")

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