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.