mirror of
https://github.com/getzep/graphiti.git
synced 2025-11-30 17:19:04 +00:00
parent
f66893fe2f
commit
9ca7ff6cf9
@ -101,9 +101,13 @@ def label_propagation(projection: dict[str, list[Neighbor]]) -> list[list[str]]:
|
|||||||
]
|
]
|
||||||
|
|
||||||
community_lst.sort(reverse=True)
|
community_lst.sort(reverse=True)
|
||||||
community_candidate = community_lst[0][1] if len(community_lst) > 0 else -1
|
candidate_rank, community_candidate = (
|
||||||
|
community_lst[0] if community_lst else (0, -1)
|
||||||
new_community = max(community_candidate, curr_community)
|
)
|
||||||
|
if community_candidate != -1 and candidate_rank > 1:
|
||||||
|
new_community = community_candidate
|
||||||
|
else:
|
||||||
|
new_community = max(community_candidate, curr_community)
|
||||||
|
|
||||||
new_community_map[uuid] = new_community
|
new_community_map[uuid] = new_community
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user