search_rw: Search network using switcher-random walk process

Description Usage Arguments Details Value References Examples

Description

Traverses a network using a switcher-random walk process and records the number of steps required to get from node start to node observe.

Usage

1
2
search_rw(adjlist, start, observe, nmax = 1000L, pjump = 0,
  type = 0L)

Arguments

adjlist

a list containing row indices of nodes adjacent node to the ith node as created by get_adjlist.

start

integer vector of length 1 or larger specifying the index of the start node.

observe

integer vector of length 1 or larger specifying the target end nodes.

nmax

integer specifying the maximum number of steps before search terminates.

pjump

numeric specifying the probability of a jump.

type

integer controlling network start and jump nodes. For type = 0 the process selects the start node and any jump nodes proportional to their degree. For type = 1 the process selects a random node to serve both as the start node and the jump node. For type = 2 the process selects the start and any jump nodes uniformly at random.

Details

If a node specified in observe has never been visited then the function returns nmax for that node.

Value

Numeric, 3 column matrix containing in each row the start node, the end node, and the (minimum) number of steps it took to reach the end node from the start node.

References

Wulff, D. U., Hills, T., & Mata, R. (2018, October 29). Structural differences in the semantic networks of younger and older adults. https://doi.org/10.31234/osf.io/s73dp

Goni, J., Martincorena, I., Corominas-Murtra, B., Arrondo, G., Ardanza- Trevijano, S., & Villoslada, P. (2010). Switcher-random-walks: A cognitive- inspired mechanism for network exploration. International Journal of Bifurcation and Chaos, 20(03), 913-922.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# generate watts strogatz graph
network = grow_ws(n = 100, k = 10)

# observe number of steps from node 2 and 6
# to nodes 3, 4, and 5
search_rw(get_adjlist(network), c(2, 6), c(3, 4, 5))

# observe number of steps from node 2 and 6 to nodes 3, 4, and 5
# with high jump probability
search_rw(get_adjlist(network), start = c(2, 6), observe = c(3, 4, 5), pjump = .5)

memnet documentation built on May 2, 2019, 9:35 a.m.