remove_empty_nodes#
- remove_empty_nodes(k, inplace=True)#
Remove all nodes with degree 0.
- Parameters:
k (PlanarDiagram) – Diagram to clean.
inplace (bool) – If False, operate on a copy.
- Returns:
The mutated diagram (or the new copy if
inplace=False
).- Return type: