From 010ef801d5fbe5b68cf77c1126a96194584c2767 Mon Sep 17 00:00:00 2001 From: Peter Dobsan Date: Sun, 24 Sep 2023 23:25:47 +0200 Subject: [PATCH] raise RuntimeError from "canon_graph() if colored --- src/pynauty/graph.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pynauty/graph.py b/src/pynauty/graph.py index c10fc9e..ccb0f1a 100644 --- a/src/pynauty/graph.py +++ b/src/pynauty/graph.py @@ -223,6 +223,8 @@ def canon_graph(g): return -> new canonical graph. ''' + if g.vertex_coloring: + raise RuntimeError("canon_graph() is not implemented for vertex-colored graphs yet.") c = certificate(g) set_length = len(c) // g.number_of_vertices sets = [c[set_length*k:set_length*(k+1)] for k in range(g.number_of_vertices)]