I created a random (Erdos-Renyi) graph that has 100 nodes. I set the attribute value for all 100 nodes to 0. I find the node with the maximum degree (most neighbors) and change its attribute value from 0 to 1. Then, using node as the root of the node and another node as the second root of the node, I I do the first width search (BFS) on the network.
This is related to this question .
I do the first width search as follows:
bfs <- graph.bfs(graph, root = c(root_node, root_node2), unreachable = FALSE,
order = TRUE, dist = TRUE)
I want to look at the neighbors of the first root node, then the neighbors of the second root node, then the neighbors of the first root node neighbors, then the neighbors of the second root node neighbors, etc.
So something like this:
O
| # and O! is the second root node
|
O----O----O!----O----O*----O----O----O
| |
| |
O O
So, for starters, the neighbors of the first root node look:
O
|
|
O----O----O!----O====O*====O----O----O
| ||
| ||
O O
Then the neighbors of the second root node look:
O
|
|
O----O====O!====O----O*----O----O----O
|| |
|| |
O O
node :
O
||
||
O----O----O!----O----O*----O====O----O
| |
| |
O O
node :
O
|
|
O====O----O!----O----O*----O----O----O
| |
| |
O O
, :
O
|
|
O----O----O!----O----O*----O----O====O
| |
| |
O O
node, 0 1, , , , node .
, , , ? , 6 ( ).
: - (.. ).
, . , .
. !