Graph.is_leaf
- Graph.is_leaf(key)[source]
Verify if a node is a leaf.
- Parameters:
- keyhashable
The identifier of the node.
- Returns:
- bool
True or False.
See also
leaves()
is_node_connected()
Notes
A node is a leaf if it has only one neighbor.
Site Navigation
Verify if a node is a leaf.
The identifier of the node.
True or False.
See also
leaves()
is_node_connected()
Notes
A node is a leaf if it has only one neighbor.