You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.Rmd
+102-3Lines changed: 102 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -55,8 +55,11 @@ Data has to be a 3 columns data.frame or matrix containing from, to and a cost/d
55
55
-`get_distance_pair` : compute distances between origin and destination by pair (*one-to-one*),
56
56
-`get_path_pair` : compute shortest paths between origin and destination by pair (*one-to-one*),
57
57
-`get_multi_paths` : compute shortest paths between all origin nodes and all destination nodes (*one-to-many*),
58
-
-`get_isochrone` : compute isochrones/isodistances with one or multiple breaks.
59
-
58
+
-`get_isochrone` : compute isochrones/isodistances with one or multiple breaks.
59
+
-`cpp_simplify` : remove non-intersection nodes, duplicated edges and isolated loops in the graph. Graph topology is preserved so distance calculation is faster and remains true. This function can be applied to very large graphs (several millions of nodes).
60
+
61
+
62
+
###Path algorithms
60
63
The choice between all the algorithms is available for *one-to-one* calculation like `get_distance_pair` and `get_path_pair`.
61
64
In these functions, uni-directional Dijkstra algorithm is stopped when the destination node is reached.
62
65
`A*` and `NBA*` are relevant if geographic coordinates of all nodes are provided. Note that coordinates should be expressed in a **projection system**.
@@ -184,7 +187,104 @@ p
184
187
185
188
```
186
189
190
+
###Graph simplification
191
+
`cpp_simplify`'s internal function performs two major steps :
192
+
193
+
- removing non-intersection nodes between two intersection nodes then calculate cost of the new edges,
194
+
- removing duplicate edges that are potentially created in the first step.
195
+
In order to remove maximum number of nodes, some iterations are needed until only intersection nodes are remained.
Here, junction nodes are `e`, `h`, `d`, `k`, `l`, `i` and `m`. So `b`, `c`, `f` and `n` have been contracted in the first step of the function. By contracting `n`, an edge with cost of 2 has been created between `m` and `l` nodes.
236
+
The second step of the function has removed this edge which is greater than the original one (e.g 1), and the whole process now need a second iteration to remove `m` and `l` that aren't intersection nodes anymore.
Here are running times in second on graphs of different sizes (data presented here, TEXAS road network from [SNAP](http://snap.stanford.edu/data/roadNet-TX.html) and french road network from OpenStreetMap and extracted with [osm2po](https://osm2po.de/) tool).
0 commit comments