-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
This toy example suggests a problem with our current approach to creating graphs:
In [13]: A = np.array([[0,1,0],[1,0,1],[0,0,0]])
In [14]: A
Out[14]:
array([[0, 1, 0],
[1, 0, 1],
[0, 0, 0]])
In [15]: import networkx as nx
In [16]: G = nx.from_numpy_array(A)
In [17]: G.is_directed()
Out[17]: FalseIt seems that if we have an asymmetric matrix we need to be explicit about using the nx.DiGraph constructor.
A utility function for determining which graph constructor to use (and performing other potentially useful preprocessing, like removing self-loops) would probably be useful here.
Metadata
Metadata
Assignees
Labels
No labels