pyhgf.utils.list_branches#

pyhgf.utils.list_branches(node_idxs, edges, branch_list=[])[source]#

Return the branch of a network from a given set of root nodes.

This function searches recursively and lists the parents above a given node. If all the children of a given parent are on the exclusion list, this parent is also excluded.

Parameters:
node_idxs

A list of node indexes. The nodes can be input nodes or any other node in the network.

edges

The nodes structure.

branch_list

The list of nodes that are already excluded (i.e )

Returns:
branch_list

The list of node indexes that belong to the branch.

Parameters:
  • node_idxs (List)

  • edges (Tuple)

  • branch_list (List)

Return type:

List