Skip to content
Snippets Groups Projects

pydtn agkmeans and version 1.0

Merged Hunter McConnell (rtm534) requested to merge summer2022 into develop
2 files
+ 5
8
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 3
6
@@ -104,10 +104,7 @@ class Community:
graph = self.graph
if not graph.has_edge(node_a, node_b):
graph.add_edge(node_a, node_b, {
'start': None,
'weight': 0,
})
graph.add_edge(node_a, node_b, start = None, weight = 0)
edge = graph[node_a][node_b]
if edge['start'] is None:
@@ -219,7 +216,7 @@ class KCliqueCommunity(Community):
def partition(self):
"""Partition graph by k-clique communities method."""
return nx.k_clique_communities(self.graph_old, k=self.k)
return nx.algorithms.community.k_clique_communities(self.graph_old, k=self.k)
class LouvainCommunity(Community):
@@ -237,7 +234,7 @@ class LouvainCommunity(Community):
}
graph.add_nodes_from(nodes)
for node_a, node_b, weight in self.graph_old.edges(data='weight'):
graph.add_edge(id(node_a), id(node_b), {'weight': weight})
graph.add_edge(id(node_a), id(node_b), weight = weight)
partitions = louvain_partition(graph)
Loading