is_connected_sum#

is_connected_sum(g: PlanarDiagram) bool#

Determine if the given planar diagram represents a connected sum.

A connected sum is checked if there is an arc-cut-set of order 2, i.e. removing two arcs from the diagram disconnects it into two components.

Args:

g (PlanarDiagram): A planar diagram to check for connected sum property.

Returns:

bool: True if the diagram is a connected sum; otherwise, False.