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

Action: Returns the shortest cycle graph that includes the specified graph vertex.

Filename: kern/kern_scm/graph_scm.cxx

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

Arg Types: in-graph graph

in-vertex string | entity

Returns: graph

Description: This extension can be used to trim away branches off of a cyclic graph.


in-graph specifies a graph.


in-vertex could be either a designation string of the graph or a model entity associated with a graph vertex.

Example: ; graph:shortest-cycle

; 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:shortest-cycle g1 "me"))

;; g2

(define g3 (graph:shortest-cycle g1 "FIDO"))

;; g3
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0060.HTM