graph:order-cyclic
 List of: Scheme Extensions Subjects: Graph Theory Contents: Kernel
Action: Assigns a sequence order to the vertices of a cyclic graph.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:order-cyclic in-graph in-first in-last)

Arg Types: in-graph graph

in-first string | entity

in-last string | entity

Returns: integer

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. The extension returns the number of vertices in the graph.

in-graph specifies a graph.

in-first could be either a vertex or a string representing the vertex in the graph.

in-last could be either a vertex or a string representing the vertex in the graph.

Example: ; graph:order-cyclic

; 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.

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

;; g2

(graph:cycle? g2)

;; #t

(graph:order-cyclic g2 "me" "them")

;; 4

(graph:show-order g2)

;; ("they 4" "them 3" "us 2" "you 1" "me 0")
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0056.HTM