-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (19 loc) · 700 Bytes
/
Copy pathmain.py
File metadata and controls
23 lines (19 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
import os
from algo import edge_cluster
from import_graph import *
from display import display_in_and_out
from networkx import spring_layout
script_dir = os.path.dirname(os.path.realpath('__file__'))
dataset_name = sys.argv[1]
full_path = os.path.join(script_dir,"dataset",dataset_name)
#Import the graph and associated info
G = import_graph(full_path).to_undirected()
pos = import_position(full_path)
#Clustering, this may take a while
com,interfaces,W,insides = edge_cluster(G)
#Display the results
if pos=={}:
pos = nx.spring_layout(G)
#edge_cluster_graph(G,dict2list(com),pos,figsize = (20,10),node_size = 0)
display_in_and_out(G,insides,interfaces,pos)