Optimal Graph Partition using the Persistence

Calculate the optimal vertex partition of a graph using the persistence as objective function. These subroutines have been used in Avellone et al. and Avellone et al. . This package is deprecated and has been superseded by the 'scalednap' package, which provides the same functionality and additional features; new and existing users should install 'scalednap' instead.


persistence

Deprecated. persistence has been superseded by the scalednap package — a strict superset with the same functions and more — and is being retired from CRAN. Please install scalednap instead: install.packages("scalednap") (the same algorithm is also available for Python: pip install scalednap).

The goal of persistence is to …

Installation

You can install the stable version of persistence from CRAN with:

install.packages("persistence")

If you want to try the latest development version with the newest updates, you can install it from CRAN using:

# install.packages("pak")
pak::pak("aavellone/persistenceR")

Example

This is a basic example which shows you how to solve a common problem using persistence:

library(persistence)

# --- EXAMPLE 1: Standard input (vectors and matrices) ---
edg <- c(1, 2, 1, 3, 1, 4, 2, 3, 3, 4, 4, 5, 5, 6, 5, 7, 6, 7)
edge_list <- matrix(edg, ncol = 2, byrow = TRUE)
vertex <- c(1, 2, 3, 4, 5, 6, 7)

cluster_milano(x = vertex, edge_list = edge_list)
#> $membership
#> [1] 1 1 1 1 2 2 2
#> 
#> $score
#> [1] 0.7662338
#> 
#> $seed
#> [1] "3563829245"

# --- EXAMPLE 2: igraph input ---
if (requireNamespace("igraph", quietly = TRUE)) {
  g <- igraph::make_ring(10)
  cluster_milano(g)
}
#> $membership
#>  [1] 1 1 2 2 3 3 4 4 5 5
#> 
#> $score
#> [1] 1.5
#> 
#> $seed
#> [1] "806094222"

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("persistence")

1.0.1 by Alessandro Avellone, a month ago


Browse source code at https://github.com/cran/persistence


Authors: Alessandro Avellone [aut, cre] , Paolo Bartesaghi [aut] , Stefano Benati [aut] , Rosanna Grassi [aut]


Documentation:   PDF Manual  


GPL (>= 2) license


Suggests igraph

System requirements: C++20


See at CRAN