-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest1.py
36 lines (26 loc) · 783 Bytes
/
test1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from graph import *
network = create_graph()
join(network,"g")
connect(network,"a","b")
connect(network,"a","c")
connect(network,"b","c")
connect(network,"b","d")
connect(network,"c","d")
connect(network,"c","f")
connect(network,"d","e")
connect(network,"d","f")
## another way of adding with edges-list
# left = tuple("AAABDE")
# right = tuple("BCEEEF")
# edges = list(zip(left, right))
# network.add_edges_from(edges)
draw_graph(network)
print are_friends(network,"c","a")
print network_triads(network,"c")
print recommend_by_number_of_common_friends(network,"a")
print recommend_by_influence(network,"a")
print no_of_components(network)
print in_same_network(network,"g","b")
# stop_further_change(network)
# connect(network,"s","a")
print user_summary(network,"a")