示例#1
0
 def test_digraph_to_matrix(self):
     # add some edges to digraph
     digraph = nx.DiGraph(self.simple_digraph)
     edges = [(1, 2, {"weight": 1}), (2, 3, {"weight": 1}), (3, 4, {"weight": 1})]
     digraph.add_edges_from(edges)
     # nx.draw_circular(digraph)
     # plt.show()
     matrix = FCM.digraph_to_matrix(digraph)
     """for row in matrix.keys():
示例#2
0
 def test_digraph_to_matrix(self):
     #add some edges to digraph
     digraph = nx.DiGraph(self.simple_digraph)
     edges = [(1, 2, {
         'weight': 1
     }), (2, 3, {
         "weight": 1
     }), (3, 4, {
         "weight": 1
     })]
     digraph.add_edges_from(edges)
     #nx.draw_circular(digraph)
     #plt.show()
     matrix = FCM.digraph_to_matrix(digraph)
     '''for row in matrix.keys():