Disperse flows throughout a network based on a input vectors of origin points and associated densities

dodgr_flows_disperse(graph, from, dens, contract = FALSE, k = 2,
  heap = "BHeap", quiet = TRUE)

Arguments

graph

data.frame or equivalent object representing the network graph (see Details)

from

Vector or matrix of points from which aggregate dispersed flows are to be calculated (see Details)

dens

Vectors of densities correponsing to the from points

contract

If TRUE, calculate flows on contracted graph before mapping them back on to the original full graph (recommended as this will generally be much faster).

k

Width coefficient of exponential diffusion function defined as exp(-d/k). If value of k<0 is given, a standard logistic polynomial will be used.

heap

Type of heap to use in priority queue. Options include Fibonacci Heap (default; FHeap), Binary Heap (BHeap), Radix, Trinomial Heap (TriHeap), Extended Trinomial Heap (TriHeapExt, and 2-3 Heap (Heap23).

quiet

If FALSE, display progress messages on screen.

Value

Modified version of graph with additonal flow column added.

Examples

graph <- weight_streetnet (hampi) from <- sample (graph$from_id, size = 10) dens <- rep (1, length (from)) # Uniform densities graph <- dodgr_flows_disperse (graph, from = from, dens = dens) # graph then has an additonal 'flows` column of aggregate flows along all # edges. These flows are directed, and can be aggregated to equivalent # undirected flows on an equivalent undirected graph with: graph_undir <- merge_directed_flows (graph)