assorted_dyads: Retrieve Shortest Paths for Assorted Dyads

Description Usage Arguments Details Value

View source: R/targbetween.R

Description

This helper function retrieves the set of shortest paths connecting each dyad of vertices specified in a two-column data.frame (column 1 = source, column 2 = destination), for subsequent use by compute_targbetween.

Usage

1
assorted_dyads(network, dyads, directed = FALSE)

Arguments

network

An igraph network graph

dyads

A two-column data.frame, with two vertices in each row, indicating the dyads to be considered in the analysis

directed

A boolean value indicating whether the network should be treated as directed (default = FALSE)

Details

This function should not be called directly. Instead, provide the network and the set of dyads that you want to analyze to targbetween. That function calls assorted_dyads as needed.

WARNING: This function may be extremely slow when the number of rows in dyads is large, as all_shortest_paths must be separately run for each individual dyad. If all source vertices correspond to the same set of destination vertices, targbetween_alldyads should be used, as this calls one_to_many, instead of using targbetween to call assorted_dyads. The targbetween_alldyads function takes a vector of source vertices and a vector of destination vertices as arguments, and it is either length(source) or length(destination) times faster than targbetween, whichever is larger.

Value

A list of shortest paths between the pairs of vertices indicated in each row of dyads.


bcbritt/targbetween documentation built on April 21, 2021, 6:12 p.m.