rigraph icon indicating copy to clipboard operation
rigraph copied to clipboard

Label propagation "initial" parameter should be treated as index vector

Open szhorvat opened this issue 3 years ago • 2 comments

The initial parameter of cluster_label_propagation now takes a vector with values in the range [0, n-1] where n is the vertex count. Values outside this range are rejected by the C core. Effectively, these values are community indices. Since R uses 1-based indexing, this parameter should also use the range [1, n].

Converted to issue from chat discussion so it wouldn't be forgotten.

szhorvat avatar May 26 '22 11:05 szhorvat

The type of the initial argument is now modified in functions.yaml in the develop branch to be an INDEX_VECTOR and not an arbitrary VECTOR_INT. This means that R will convert between 1-based and 0-based indices in the generated code once we update the R interface to use igraph 0.10 or later. I believe that's all that is needed on the R side now.

ntamas avatar May 26 '22 11:05 ntamas

I'll keep this open so that the docs / changelog can be updated when the time comes for R/igraph 2.0.

szhorvat avatar May 26 '22 12:05 szhorvat