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 (list) – A list of node indexes. The nodes can be input nodes or any other node in the network.
edges (tuple) – The nodes structure.
branch_list (list) – The list of nodes that are already excluded (i.e )
- Returns:
The list of node indexes that belong to the branch.
- Return type:
branch_list