Commit 51f71fb9 authored by Yoann Dufresne's avatar Yoann Dufresne
Browse files

bugfix: empty clique don't bug anymore

parent e4003d29
......@@ -30,6 +30,13 @@ class CliqueDGFactory(AbstractDGFactory):
clq_per_node[node] = []
# 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:
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:
nei_clqs = clq_per_node[nei]
# Pair useful cliques
for nei_clq in nei_clqs:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment