Skip to content

Commit

Permalink
📝 temporal clustering bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Feb 17, 2021
1 parent 40a4ad8 commit 325d816
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cdlib/classes/temporal_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ def lifecycle_polytree(self, method=None, two_sided=False):
lifecycle = self.community_matching(method, two_sided)

pt = nx.DiGraph()
for u, v, w in lifecycle:
pt.add_edge(u, v, weight=w)
if len(lifecycle[0]) == 3:
for u, v, w in lifecycle:
pt.add_edge(u, v, weight=w)
else:
# implicit matching
for u, v in lifecycle:
pt.add_edge(u, v)

return pt

0 comments on commit 325d816

Please sign in to comment.