Function output of the spanning_tree function where the input graph is graph, backwards index is index, and the spanning tree is tree

get spanning tree graph

Format:

output of the spanning_tree function where the input graph is graph, backwards index is index, and the spanning tree is tree

Input:

list graph -
number index -
list tree -

Output:

list - None

Properties that reference this function:

spanning tree of graph graph starting at node v = output of the spanning_tree function where the input graph is graph, backwards index is 0, and the spanning tree is [ node (v, [ ]), [ ] ] (construct spanning tree begin)

Conditional properties that reference this function:

  • if the following are true:
    • children of the node at backwards index i of tree tree in graph graph = children
    • result of adding children to tree tree as children of the node at backwards index i = new_tree

    then output of the spanning_tree function where the input graph is graph, backwards index is i, and the spanning tree is tree = output of the spanning_tree function where the input graph is graph, backwards index is (i + 1), and the spanning tree is new_tree

    (link)
  • if i = (length of stack tree) - 1, then output of the spanning_tree function where the input graph is graph, backwards index is i, and the spanning tree is tree = tree (link)


Comments

Please log in to add comments