Description Usage Arguments Value Note Author(s) Examples
tool.subgraph.find
finds the edge lists between given seed nodes
and their neighbors
1 | tool.subgraph.find(seeds, edgemap, heads, visited)
|
seeds |
seed nodes' indices |
edgemap |
list of adjacent edge information for entire graph.
|
heads |
list of either head (destination) or tail (source) nodes of the entire graph |
visited |
flag holding already visited node indices during neighborhood searching |
neighbors |
neighbor edge lists of seed nodes (for either tails or heads) |
Neighbor edge lists of the seed nodes should be obtained separately for tail and head nodes.
Ville-Petteri Makinen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(job_kda_analyze)
depth <- 1
direction <- 0
## Take one or multiple center nodes (seeds) to search the neighborhoods:
## e.g. take the first node in the graph as the seed, find its neighborhood:
center.node = job.kda$graph$nodes[1]
## Convert center node (seed) names to indices:
nodes <- job.kda$graph$nodes
ranks <- match(center.node, nodes)
ranks <- ranks[which(ranks > 0)]
## we already know that rank is 1, since we took the first node in the graph
## as an example:
ranks <- as.integer(ranks)
## Find edges to adjacent nodes. (both up- and down-stream searches)
visited <- ranks
foundT <- tool.subgraph.find(ranks, job.kda$graph$tail2edge,
job.kda$graph$heads, visited)
foundH <- tool.subgraph.find(ranks, job.kda$graph$head2edge,
job.kda$graph$tails, visited)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.