If you really cannot afford the memory , even with the minimizations in your graphical representation , you can develop the Dijkstra algorithm algorithm , taking into account the divide and win .
The idea is to divide the data into secondary fragments, so that you can execute the Dijkstra algorithm in each fragment for each of the points inside it.
For each solution generated in these junior fragments, consider it as a unique node for another piece of data from which you will start another Dijkstra run.
For example, consider the following points:
.B .C .E .A .D .F .G
You can select the nearest points for a given node, say, for two jumps, and then use the solution as part of an extended graph, considering the previous points as only one set of points with a distance equal to the resulting distance of the Dijkstra solution.
Say you start with D :
- select
closest points - D within the specified number of hops ; - use Dijkstra's algorithm for selected records, starting with
D ; - use a graphical solution with a central node
D and the last nodes in the shortest paths as nodes directly connected to D ; - we expand the graph by repeating the algorithm until all nodes are considered.
Although there is expensive additional processing here , you can overcome the memory limit , and if you have other machines, you can even distribute the processes.
Please note that this is just a process idea; the process I described is not always the best way to do this. You may find something interesting in the search for Dijkstra's distributed algorithm.
Rubens
source share