auto_color_edges

auto_color_edges(edges)[source]

Color the input edges of an undirected graph such that no two incident edges share a color.

Parameters:

edges (Sequence[tuple[int, int]]) – The edges describing an undirected graph.

Returns:

A dictionary mapping each edge to an integer representation of a color.

Return type:

dict[tuple[int, int], int]