Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compare_heaps

compare_heaps


Description

Perform timing comparison between different kinds of heaps as well as with equivalent igraph routine distances. To do this, a random sub-graph containing a defined number of vertices is first selected. Alternatively, this random sub-graph can be pre-generated with the dodgr_sample function and passed directly.

Usage

compare_heaps(graph, nverts = 100, replications = 2)

Arguments

graph

data.frame object representing the network graph (or a sub-sample selected with codedodgr_sample)

nverts

Number of vertices used to generate random sub-graph. If a non-numeric value is given, the whole graph will be used.

replications

Number of replications to be used in comparison

Value

Result of rbenchmark::benchmark comparison in data.frame form.

Note

igraph caches intermediate results of graph processing, so the igraph comparisons will be faster on subsequent runs. To obtain fair comparisons, run only once or re-start the current R session.

See Also

Examples

graph <- weight_streetnet (hampi)
## Not run: 
compare_heaps (graph, nverts = 1000, replications = 1)

## End(Not run)

dodgr

Distances on Directed Graphs

v0.2.11
GPL-3
Authors
Mark Padgham [aut, cre], Andreas Petutschnig [aut], Robin Lovelace [ctb], Andrew Smith [ctb], Malcolm Morgan [ctb], Shane Saunders [cph] (Original author of included code for priority heaps)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.