How to create a new flicker of centrality?

I want to build a new measure of centrality using igraph, preferably in R.

How do i get started?

For example, would it be better to add to igraph C libraryor R interface?

+3
source share
1 answer

It really comes down to what you like. However, igraph is primarily a C library (you can view all source code on sourceforge ), so the most logical way to extend it is probably in C. For example, the proximity function in R simply calls the associated C function:

> closeness
function (graph, v = V(graph), mode = c("all", "out", "in")) 
{
    if (!is.igraph(graph)) {
        stop("Not a graph object")
    }
    mode <- igraph.match.arg(mode)
    mode <- switch(mode, out = 1, `in` = 2, all = 3)
    on.exit(.Call("R_igraph_finalizer", PACKAGE = "igraph"))
    .Call("R_igraph_closeness", graph, as.igraph.vs(v), as.numeric(mode), 
        PACKAGE = "igraph")
}

.

+4

Source: https://habr.com/ru/post/1724144/


All Articles