Graph.is_leaf
-
Graph.
is_leaf
(key)[source] Verify if a node is a leaf.
- Parameters
key (hashable) – The identifier of the node.
- Returns
bool – True or False.
Notes
A node is a leaf if it has only one neighbor.
Graph.
is_leaf
(key)[source]Verify if a node is a leaf.
key (hashable) – The identifier of the node.
bool – True or False.
Notes
A node is a leaf if it has only one neighbor.