def is_planar(graph):
    """Determines whether a graph is planar or not."""
    # Determine connected components as subgraphs; their planarity is independent of each other
    connected_components = get_connected_components_as_subgraphs(graph)
    for component in connected_components:
        # Biconnected components likewise have independent planarity
        biconnected_components = find_biconnected_components_as_subgraphs(component)
        for bi_component in biconnected_components:
            planarity = __is_subgraph_planar(bi_component)
            if not planarity:
                return False
    return True
def is_planar ( graph ) : connected_components = get_connected_components_as_subgraphs ( graph ) for component in connected_components : biconnected_components = find_biconnected_components_as_subgraphs ( component ) for bi_component in biconnected_components : planarity = __is_subgraph_planar ( bi_component ) if not planarity : return False return True
Determines whether a graph is planar or not.