Find a large independent set in a thresholded similarity/distance matrix
Source:R/RcppExports.R
fast_indep_cpp.RdFaithful port of FastIndep (Abraham 2013): the deterministic greedy heuristic
plus n_runs - 1 stochastic runs. Two nodes are "related" (an edge) when the
matrix entry crosses threshold in the sense given by distance; an
independent set has no edges among its members. The matrix diagonal is ignored.
Arguments
- sim
Symmetric numeric matrix. A similarity (higher = more related,
distance = false) or a distance (lower = more related,distance = true).- threshold
Edge cutoff. Similarity: edge if
sim[i,j] >= threshold. Distance: edge ifsim[i,j] <= threshold.- n_runs
Total runs: 1 = greedy only;
> 1addsn_runs - 1stochastic runs and returns the distinct sets found.- seed
Seed for the stochastic runs (self-contained splitmix64 PRNG; independent of R's RNG). The greedy run is deterministic and seed-free.
- distance
If
true,simis a distance and the edge sense is inverted (edge if<= threshold). Defaultfalse(similarity).