Skip to content

Commit

Permalink
move up check
Browse files Browse the repository at this point in the history
  • Loading branch information
guojing0 committed Jul 27, 2024
1 parent 7350b4c commit 52aaff4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sage/graphs/homomorphisms/count_homomorphisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 52aaff4

Please sign in to comment.