Skip to content

Commit 499ae52

Browse files
updated the test
1 parent d09ba14 commit 499ae52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CliquePercolationMethod.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ def clique_percolation_method(graph, k = 3):
3333

3434

3535
def test():
36-
g = Graph([(0, 1), (0, 2), (0, 3), (1, 2), (2, 3), (3, 4), (3, 5), (4, 5), (4, 7), (4, 6), (5, 7), (5, 6), (6, 7), (6, 8)])
36+
g = Graph()
37+
g.add_vertices(["1","2","3","4","5","6","7","8","9"])
38+
g.add_edges([("1", "2"), ("1", "3"), ("1", "4"), ("2", "3"), ("3", "4"), ("4", "5"), ("4", "6"), ("5", "6"), ("5", "8"), ("5", "7"), ("6", "8"), ("6", "7"), ("7", "8"), ("7", "9")])
3739
summary(g)
3840
plot(g)
3941
communities = clique_percolation_method(g,3)
4042
print("Cliques:")
4143
for count, comm in enumerate(communities):
42-
print("{}: {}".format(count,comm))
44+
print("{}: {}".format(count,[g.vs[i]["name"] for i in comm]))
4345

4446
def test_karate():
4547
karate = Graph.Read_GraphML("karate.GraphML")

0 commit comments

Comments
 (0)