Closed Kuifje02 closed 4 years ago
Maybe the number of nodes is not the primal issue : adding some edges does not solve the problem. The same error is raised when adding edges (A,C) and (B,C) :
G = nx.DiGraph(directed=True, n_res=2)
G.add_edge("Source", "A", res_cost=array([1, 2]), weight=0)
G.add_edge("A", "B", res_cost=array([1, 0.3]), weight=0)
G.add_edge("A", "C", res_cost=array([1, 0.1]), weight=0)
G.add_edge("B", "C", res_cost=array([1, 3]), weight=-10)
G.add_edge("A", "Sink", res_cost=array([1, 10]), weight=0)
max_res, min_res = [4, 20], [1, 0]
bidirec = BiDirectional(G, max_res, min_res, direction="both")
bidirec.run()
print(bidirec.path)
When there are only 3 nodes including Source and Sink, the birectional algorithm (I have not tried the other ones) does not run.
Example :
The following exception is raised :
Exception: Please call the .run() method first