Skip to content

Commit a9b51aa

Browse files
committed
Construct directed graph.
1 parent 6a48f2b commit a9b51aa

9 files changed

+32871
-63
lines changed

construct_graph.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class Graph:
99
def __init__(self, logfile='output.log'):
10-
self._G = nx.Graph()
10+
self._G = nx.DiGraph()
1111
# create logger
1212
self._logger = logging.getLogger('construct_graph')
1313
self._logger.setLevel(logging.DEBUG)
@@ -68,6 +68,10 @@ def create_nodes_from_db(self, longabsdb_path, labelsdb_path, lookupdb_path, sub
6868

6969
count += 1
7070

71+
longabsdb.close()
72+
labelsdb.close()
73+
lookupdb.close()
74+
7175
# takes file a parameter:
7276
# file contains edge at each line, like (1, 2).
7377
def create_edges_from_file(self, path):

0 commit comments

Comments
 (0)