Skip to content
Snippets Groups Projects
Commit 51f71fb9 authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

bugfix: empty clique don't bug anymore

parent e4003d29
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,13 @@ class CliqueDGFactory(AbstractDGFactory):
clq_per_node[node] = []
clq_per_node[node].append(idx)
# clq_per_node for nei can be empty because of minimum clique size
# So we add singleton cliques for those nodes
for node in subgraph.nodes:
if node not in clq_per_node:
cliques.append([node])
clq_per_node[node] = [len(cliques) - 1]
# Pair cliques
clq_pairs = set()
for idx, clq in enumerate(cliques):
......@@ -37,10 +44,6 @@ class CliqueDGFactory(AbstractDGFactory):
neighbors = list(subgraph.neighbors(node))
# Looks into the neighbors for clique pairing
for nei in neighbors:
if nei not in clq_per_node:
print("!!!!!!!!!!!!!!!")
print(clq_per_node)
print("!!!!!!!!!!!!!!!")
nei_clqs = clq_per_node[nei]
# Pair useful cliques
for nei_clq in nei_clqs:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment