triversity (version 1.0)

get_transition_from_path: Compute the transition matrix of a random walk following a path between the levels of a tripartite graph.

Description

get_transition_from_path computes the transition matrix of a random walk following a path between the different levels of the input tripartite graph.

Usage

get_transition_from_path(tripartite, path)

Arguments

tripartite

A tripartite graph obtained by calling the get_tripartite function.

path

A vector of integers in {1, 2, 3} giving the path of the random walk between the different levels of the input tripartite graph. This path can be as long as wanted. Two successive levels should always be adjacent, that is the random walk cannot go from level 1 to level 3 (or conversely) without first going through level 2.

Value

A matrix of floats in [0,1], with all lines summing to 1, giving the transition matrix of the random walk following the input path.

Details

Note that the tripartite graph structure implemented in this package stores in memory any computed transition matrix to avoid redundant computation in the future. Hence, the first execution of get_transition_from_path, or of any other function that builds on it, can be much slower than latter calls. The transition matrices are stored within a data.tree in the input tripartite variable (see tripartite$transitions).

Examples

Run this code
# NOT RUN {
data (tripartite_example)
tripartite <- get_tripartite (data=tripartite_example)

get_transition_from_path (tripartite, c(2,1,2,3))

# }

Run the code above in your browser using DataCamp Workspace