From 52aaff4bb7c5ed4609c074ad90dfa6ba394a5c4a Mon Sep 17 00:00:00 2001 From: Jing Guo Date: Sat, 27 Jul 2024 19:45:56 +0000 Subject: [PATCH] move up check --- src/sage/graphs/homomorphisms/count_homomorphisms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/graphs/homomorphisms/count_homomorphisms.py b/src/sage/graphs/homomorphisms/count_homomorphisms.py index 1e8241473fe..62030306c7b 100644 --- a/src/sage/graphs/homomorphisms/count_homomorphisms.py +++ b/src/sage/graphs/homomorphisms/count_homomorphisms.py @@ -27,6 +27,9 @@ def __init__(self, graph, target_graph, density_threshold=0.25, graph_clr=None, if colourful and (graph_clr is None or target_clr is None): raise ValueError("Both graph_clr and target_clr must be provided when colourful is True") + self.graph._scream_if_not_simple() + self.target_graph._scream_if_not_simple() + # Only used in `__init__` from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition, label_nice_tree_decomposition @@ -41,9 +44,6 @@ def __init__(self, graph, target_graph, density_threshold=0.25, graph_clr=None, self.actual_target_graph = target_graph self.actual_target_size = self.actual_target_graph.order() - self.graph._scream_if_not_simple() - self.target_graph._scream_if_not_simple() - self.tree_decomp = graph.treewidth(certificate=True) self.nice_tree_decomp = make_nice_tree_decomposition(graph, self.tree_decomp) self.root = min(self.nice_tree_decomp)