Whenever I apply H.neighbors()
, to any node from my graph it shows none.
import networkx as nx
graph={'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D','A'],
'D': ['C'],
'E': ['F'],
'F': ['C']}
G = nx.Graph(graph)
H = G.to_directed(graph)
H = nx.DiGraph(graph)
all_adjacent_cells = ['All Adjacent Cells']
backward_cells = ['All Input Cells']
forward_cells = ['All Output Cells']
print(all_adjacent_cells.append(G.neighbors('B')))
print((backward_cells.append(H.neighbors('B'))))
Whenever I apply H.neighbors('B')
, put any node from my graph it shows
none. But the output should be
backward_cells = 2
forward_cells = 1
How can i get the numbers of neighbor input connected net and output connected net?