graph:order-from
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Sets the order of a graph starting at 0 for the specified vertex.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:order-from in-graph in-vertex)

Arg Types: in-graph graph

in-vertex string | entity

Returns: integer

Description: When ordering the graph starting at 0 for the specified in-vertex, each subsequent vertex receives a number based on how far away it is (e.g., how many edges) from the starting vertex. The integer returned is the maximum number of "hops" that one or more vertices are from the starting vertex.


in-graph specifies a graph.


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

Example: ; graph:order-from

; Create a simple graph.

(define g1 (graph "a-b b-c c-e c-d c-f f-g f-h"))

;; g1

(graph:order-from g1 "a")

;; 4

(graph:show-order g1)

;; ("a 0" "b 1" "c 2" "e 3" "d 3" "f 3" "g 4" "h 4")
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0057.HTM