NofNeighbours {GNAR}R Documentation

Calculates stage-neighbours of a network

Description

Calculates neighbour sets of a particular node in the network and their distances.

Usage

NofNeighbours(node=1, stage=2, net=GNAR::fiveNet)

Arguments

node

is an integer specifying which node to calculate the neighbours of.

stage

is an integer specifying the maximum neighbour-stage to calculate to.

net

a GNARnet object with edge list and distance list.

Details

Note that the distances are calculated as the sum along the shortest path; do not use this with a weights (rather than distance) list. Stage-r neighbours of node i are denoted N^(r)(i), and are nodes that are r edges (but no fewer) away from i. Hence stage-1 neighbours are the immediate neighbours, stage-2 neighbours are the neighbours of neighbours and so on.

Value

edges

is a list of length stage, where edges[[i]] is a vector containing the nodes that are stage-i neighbours of node.

dist

is a list of length stage, where dist[[i]] is a vector containing the distances from node to its stage-i neighbours, with ordering as in edges[[i]].

Examples

#First and second stage neighbours of node 1 in fiveNet
NofNeighbours()

[Package GNAR version 1.1.3 Index]