BaseNetwork.is_leaf

BaseNetwork.is_leaf(key)

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.