List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Returns a number representing the distance a given graph vertex is from the 0 node in the given ordered graph.

Filename: kern/kern_scm/graph_scm.cxx

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

Arg Types: in-graph graph

in-vertex string | entity

Returns: integer

in-graph specifies a graph.

in-vertex could be either the designation name used as part of the graph or the model entity associated with that graph vertex.

Example: ; graph:get-order

; 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:get-order g1 "a")

;; 0

(graph:get-order g1 "b")

;; 1

(graph:get-order g1 "h")

;; 4

(graph:show-order g1)

;; ("a 0" "b 1" "c 2" "e 3" "d 3" "f 3" "g 4" "h 4")