11cppRouting package
22================
33Vincent LARMET
4- 15 juin 2019
4+ July 6, 2019
55
66Package presentation
77====================
@@ -148,7 +148,7 @@ pair_dijkstra<-get_distance_pair(graph,origin,destination)
148148 ## Running Dijkstra ...
149149
150150 ## user system elapsed
151- ## 58.87 0.74 59.86
151+ ## 58.47 0.77 59.52
152152
153153#### Using bi-directional Dijkstra algorithm
154154
@@ -162,7 +162,7 @@ pair_bidijkstra<-get_distance_pair(graph,origin,destination,algorithm = "bi")
162162 ## Running bidirectional Dijkstra...
163163
164164 ## user system elapsed
165- ## 39.92 1.40 41.75
165+ ## 37.04 1.42 38.50
166166
167167#### Using A\* algorithm
168168
@@ -178,7 +178,7 @@ pair_astar<-get_distance_pair(graph,origin,destination,algorithm = "A*",constant
178178 ## Running A* ...
179179
180180 ## user system elapsed
181- ## 32.85 1.93 34.87
181+ ## 31.64 1.95 33.65
182182
183183#### Using NBA\* algorithm
184184
@@ -192,7 +192,7 @@ pair_nba<-get_distance_pair(graph,origin,destination,algorithm = "NBA",constant
192192 ## Running NBA* ...
193193
194194 ## user system elapsed
195- ## 18.34 2.97 21.32
195+ ## 17.89 2.88 20.82
196196
197197#### Output
198198
@@ -201,12 +201,12 @@ head(cbind(pair_dijkstra,pair_bidijkstra,pair_astar,pair_nba))
201201```
202202
203203 ## pair_dijkstra pair_bidijkstra pair_astar pair_nba
204- ## [1,] 370.2267 370.2267 370.2267 370.2267
205- ## [2,] 173.4823 173.4823 173.4823 173.4823
206- ## [3,] 609.7753 609.7753 609.7753 609.7753
207- ## [4,] 460.4252 460.4252 460.4252 460.4252
208- ## [5,] 407.5842 407.5842 407.5842 407.5842
209- ## [6,] 320.0234 320.0234 320.0234 320.0234
204+ ## [1,] 822.8825 822.8825 822.8825 822.8825
205+ ## [2,] 255.7911 255.7911 255.7911 255.7911
206+ ## [3,] 410.9381 410.9381 410.9381 410.9381
207+ ## [4,] 613.2455 613.2455 613.2455 613.2455
208+ ## [5,] 327.6106 327.6106 327.6106 327.6106
209+ ## [6,] 357.9866 357.9866 357.9866 357.9866
210210
211211##### In ` get_distance_pair ` function, all the algorithms can be ran in parallel by setting TRUE to allcores argument.
212212
@@ -338,7 +338,7 @@ system.time(
338338```
339339
340340 ## user system elapsed
341- ## 14.81 1.37 16.24
341+ ## 14.77 0.97 15.79
342342
343343##### Compare outputs
344344
@@ -347,7 +347,7 @@ summary(pair_nba-pair_nba_2)
347347```
348348
349349 ## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
350- ## 0 0 0 0 0 0 35
350+ ## 0 0 0 0 0 0 42
351351
352352#### Running time
353353
475475</tr >
476476</tbody >
477477</table >
478-
479478Applications
480479============
481480
@@ -552,7 +551,7 @@ The shortest travel time is computed with the `cppRouting` function `get_distanc
552551We compute travel time from all commune nodes to all maternity ward nodes (e.g ~ 36000\* 400 distances).
553552
554553``` r
555- # Distance matrix (around 10 minutes to compute)
554+ # Distance matrix (few seconds to compute)
556555dists <- get_distance_matrix(graph ,
557556 from = ndcom $ id_noeud ,
558557 to = ndcom $ id_noeud [ndcom $ com %in% maternity $ CODGEO ],
@@ -605,7 +604,7 @@ system.time(
605604```
606605
607606 ## user system elapsed
608- ## 89.63 0.02 89.83
607+ ## 88.33 0.03 88.55
609608
610609``` r
611610# dodgr
@@ -626,7 +625,7 @@ test_dodgr<-dodgr_dists(graph=data.frame(roads2),from=origin,to=destination,para
626625```
627626
628627 ## user system elapsed
629- ## 90.09 0.09 90.78
628+ ## 87.47 0.02 87.70
630629
631630``` r
632631# cppRouting
@@ -636,7 +635,7 @@ test_cpp<-get_distance_matrix(graph,origin,destination,allcores = FALSE)
636635```
637636
638637 ## user system elapsed
639- ## 62.66 0.40 63.48
638+ ## 59.32 0.42 59.80
640639
641640#### Ouput
642641
@@ -662,7 +661,7 @@ test_dodgr<-dodgr_dists(graph=data.frame(roads2),from=origin,to=destination,para
662661```
663662
664663 ## user system elapsed
665- ## 134.15 0.42 36.97
664+ ## 126.10 0.59 33.43
666665
667666``` r
668667# cppRouting
@@ -672,7 +671,7 @@ test_cpp<-get_distance_matrix(graph,origin,destination,allcores = TRUE)
672671```
673672
674673 ## user system elapsed
675- ## 0.11 0.08 23.82
674+ ## 0.14 0.05 22.36
676675
677676Benchmark on computing shortest paths by pairs
678677----------------------------------------------
@@ -688,7 +687,7 @@ test_dodgr<-dodgr_paths(graph=data.frame(roads2),from=origin,to=destination,pair
688687```
689688
690689 ## user system elapsed
691- ## 561.26 20.80 587.54
690+ ## 531.79 18.66 551.76
692691
693692``` r
694693# cppRouting
@@ -700,7 +699,7 @@ test_cpp<-get_path_pair(graph,origin,destination,algorithm = "NBA",constant=110/
700699 ## Running NBA* ...
701700
702701 ## user system elapsed
703- ## 5.24 0.31 5.56
702+ ## 4.93 0.36 5.29
704703
705704### Test similarity of the first travel
706705
0 commit comments