ec_is_valid

Contents

ec_is_valid#

iqm.qaoa.transpiler.sparse.edge_coloring.ec_is_valid(graph)[source]#

Check that a graph’s edge coloring is valid.

Takes a graph whose edges have an attribute color and checks that no two neighboring edges have the same color (i.e., the coloring is valid).

Parameters:

graph (Graph) – A Graph whose edges have an attribute color.

Returns:

True if the edge coloring is valid, False otherwise.

Return type:

bool