How to direct information flow in a graph or ANN?
I'm building an undirected ANN. There are no distin开发者_开发知识库ct input or output nodes, and all connections are undirected.
In order to make the network work, I am designing the system to treat each node's action threshold and weighted relationship as a function of its distance from a "focus" node - a temporary output node.
In other words, I will arbitrarily select a node or group of nodes to be the endpoint and output of data. This node can change at any time. The flow of information through the graph will gravitate like magnets toward the chosen node, because it will be statistically more likely for nodes close to the the end node to active and send information down that path.
My hope is that this can create a very dynamic and realistic ANN pattern with very accurate learning patterns.
Right now I'm stuck on the issue of how to determine each node's distance from the end node efficiently. From what I've read, if I were to use Neo4j, it would take about 250ms to calculate the shortest path between two points, on average. It would be way too slow to incorporate such calculations into the algorithm, as this means the shortest path would have to be calculated repeatedly for every adjacent node to the currently "firing" nodes.
Any ideas?
... this means the shortest path would have to be calculated repeatedly for every adjacent node to the currently "firing" nodes.
Dijkstra's shortest path algorithm will find the shortest path from one node to every other node in the network - so you could find all the shortest paths to a nominated end node with one pass of the algorithm in O(N^2) time.
The Floyd-Warshall algorithm calculates the shortest path for every pair of nodes in the network in O(N^3) time and requires O(N^2) storage space. If your network doesn't change, and you can afford the up-front calculation cost, this might be a good choice.
精彩评论