is_valid_edge_coloring

is_valid_edge_coloring(coloring)[source]

Check whether an edge coloring scheme is valid.

An edge coloring is valid if no two edges of the same color share a node.

Parameters:

coloring (dict[tuple[int, int], int]) – A mapping from edges to integer representations of colors.

Returns:

A boolean indicating whether the input coloring is valid.

Return type:

bool