Well i have store into a dictionary a graph.The graph has no cycles and looks like:
G={1:[2,3,4],2:[1],3:[1],4:[1,5],5:[4]}
So in the above example node 1 is connected to node 2,3,4, node 2 is connectes to node 1 etc.. Note that any graph G is undirected!
Now, let's have one specific node and let's call them node K. I want to make a dictionary to save for any node which is the path that connect this node and node K.
Also, i want to save in one dictionary for any node how many nodes have path connection to node K, and this path includes this node.
I believe for the first problem it's not necessary to run Dijkstra's algorithm because the graph is acyclic with no cost.
Any advice would be usefull, Thx in advance