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 |
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 |
dist |
is a list of length |
Examples
#First and second stage neighbours of node 1 in fiveNet
NofNeighbours()