SchemeExt:Graph:get-order

From DocR21

Jump to: navigation, search

Contents

Action

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

Filename

scm/scmext/kern/graph_scm.cpp

APIs

None

Syntax

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

Argument Types

Argument Scheme Data Type
in-graph graph
in-vertex string | entity

Returns

integer

Arguments

  • 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")
Personal tools
Live