About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
coloring
qiskit_addon_utils.coloring
Utility methods for coloring.
auto_color_edges
auto_color_edges(edges)
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
is_valid_edge_coloring
is_valid_edge_coloring(coloring)
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
Was this page helpful?
Report a bug or request content on GitHub.