Computes betweenness via duplication of nodes with self-loops for a graph
DNSLbetweenness_for_graph.Rd
Computes the betweenness of nodes in a graph that includes self-loops directly.
Arguments
- graph.with.self.loops
An
igraph
object some of whose nodes have connections with themselves (self-loops). These nodes need to have aname
attribute; this is created automatically inigraph
if you use that for graph generation, but if the graph has been created from other sources it might not have that attribute. As a workaround, simply assign whatever node attribute works as name to the name.
Details
This method computes betweenness centrality via the duplicated nodes method mm24:intra_family_linksdupNodes for a `igraph` object. Use it when you want to just apply the DNSLbetweenness method to an already built graph. The intermediate graph obtained by duplicating nodes is hidden and discarded.
Examples
library(igraph)
V1 <- c("A", "A","B","C","D","E")
V2 <- c("A", "B","C","D","E","A")
print(DNSLbetweenness_for_graph(graph_from_data_frame(data.frame(V1,V2))))
#> A B C D E
#> 12 7 4 4 12