Action:

Assigns a sequence order to the vertices of a cyclic graph.


Filename:

kern/kern_scm/graph_scm.cxx


Syntax:

(graph:ordercyclic ingraph infirst inlast)


Arg Types:

ingraph

graph


infirst

string  entity


inlast

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.



ingraph specifies a graph.



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



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


Example:

; graph:ordercyclic


; Create a simple example


(define g1 (graph "meyou youus usthem



themthey methey



FIDOSPOT SPOTKING SPOTPETEY"))


;; 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:ordercyclic g2 "me" "them")


;; 4


(graph:showorder g2)


;; ("they 4" "them 3" "us 2" "you 1" "me 0")
