Action:

Returns a subgraph of the given input graph.


Filename:

kern/kern_scm/graph_scm.cxx


Syntax:

(graph:branch ingraph intrunk



whichbranch [keeptrunk=#f])


Arg Types:

ingraph

graph


intrunk

graph


whichbranch

integer


keeptrunk

boolean


Returns:

graph


Description:

This command returns a subgraph of the given
ingraph that is made up of all the branches that are connected to a given vertex in the ordered
intrunk graph.



ingraph specifies a graph.



intrunk specifies a graph showing all the connections to a given vertex.



whichbranch is an integer signifying the vertex to be used.



The
keeptrunk is an option to keep (#t) or not keep (#f) the vertex from the trunk.


Limitations:

The
intrunk must be a linear ordered subgraph of the
ingraph. The
whichbranch must be a nonnegative integer less than the max order of the trunk.


Example:

; graph:branch


; Create a simple graph.


(define g1 (graph "ab bc ce cd cf fg fh"))


;; g1


(define g2 (graph "bc"))


;; g2


(graph:orderfrom g2 "b")


;; 1


(graph:branch g1 g2 0)


;; #[graph "a"]


(graph:branch g1 g2 0 #t)


;; #[graph "ab"]


(graph:branch g1 g2 1)


;; #[graph "fg fh d e"]


(graph:branch g1 g2 1 #t)


;; #[graph "cd ce cf fg fh"]
