Hello Everybody,
While using R and igraph, how do I induce Sub Graphs on the basis of Node Degree?
Some thing like a graph of all nodes and edges with node degrees less that say 5
Thanks in anticipation
SHRINIVAS
Hello Everybody,
While using R and igraph, how do I induce Sub Graphs on the basis of Node Degree?
Some thing like a graph of all nodes and edges with node degrees less that say 5
Thanks in anticipation
SHRINIVAS
Are you looking for a k-core decomposition?
If so, use the coreness()
function to find the coreness of each vertex. Select vertices with coreness \ge k for your chosen k, take the corresponding induced subgraph and look for connected components.
Thank you Sir for the prompt response
My Graph has the following Degree distribution
1 2 3 4 5 6 7 8 9 10 11 12 14 25 31
105 30 27 16 33 9 5 4 2 3 2 1 2 1 1
I want to create separate graphs for Degree 1 ( 105 vertices), upto degree 31 with 1 vertex.
Look forward to your guidance
Regards
SHRINIVAS
Hi Dharma,
“Separate graphs” may require clarification.
Dan Suthers
You should clarify if k-cores was what you meant.
Once you take a subgraph, the degrees change (since part of the original graph is excluded). k-cores consider the degrees in the subgraph. If you want to consider the degrees in the original graph, that a different problem, but a fairly trivial one: just remove small degree nodes (something like delete_vertices(g, V(G)[degree(g) < threshold])
).