These functions are wrappers around the various clustering functions provided
by igraph
. As with the other wrappers they automatically use the graph that
is being computed on, and otherwise passes on its arguments to the relevant
clustering function. The return value is always a numeric vector of group
memberships so that nodes or edges with the same number are part of the same
group. Grouping is predominantly made on nodes and currently the only
grouping of edges supported is biconnected components.
group_components(type = "weak")
group_edge_betweenness(weights = NULL, directed = TRUE, n_groups = NULL)
group_fast_greedy(weights = NULL, n_groups = NULL)
group_infomap(weights = NULL, node_weights = NULL, trials = 10)
group_label_prop(weights = NULL, label = NULL, fixed = NULL)
group_leading_eigen(
weights = NULL,
steps = -1,
label = NULL,
options = arpack_defaults(),
n_groups = NULL
)
group_louvain(weights = NULL, resolution = 1)
group_leiden(
weights = NULL,
resolution = 1,
objective_function = "CPM",
beta = 0.01,
label = NULL,
n = 2,
node_weights = NULL
)
group_optimal(weights = NULL)
group_spinglass(weights = NULL, ...)
group_walktrap(weights = NULL, steps = 4, n_groups = NULL)
group_fluid(n_groups = 2)
group_biconnected_component()
group_color()
The type of component to find. Either 'weak'
or 'strong'
The weight of the edges to use for the calculation. Will be evaluated in the context of the edge data.
Should direction of edges be used for the calculations
Integer scalar, the desired number of communities. If too low or two high, then an error message is given. The measure is applied to the full graph so the number of groups returned may be lower for focused graphs
The weight of the nodes to use for the calculation. Will be evaluated in the context of the node data.
Number of times partition of the network should be attempted
The initial groups of the nodes. Will be evaluated in the context of the node data.
A logical vector determining which nodes should keep their initial groups. Will be evaluated in the context of the node data.
The number of steps in the random walks
Settings passed on to igraph::arpack()
Resolution of the modularity function used internally in the algorithm
Either "CPM"
(constant potts model) or
"modularity"
. Sets the objective function to use.
Parameter affecting the randomness in the Leiden algorithm. This affects only the refinement step of the algorithm.
The number of iterations to run the clustering
arguments passed on to igraph::cluster_spinglass()
a numeric vector with the membership for each node in the graph. The enumeration happens in order based on group size progressing from the largest to the smallest group
group_components()
: Group by connected compenents using igraph::components()
group_edge_betweenness()
: Group densely connected nodes using igraph::cluster_edge_betweenness()
group_fast_greedy()
: Group nodes by optimising modularity using igraph::cluster_fast_greedy()
group_infomap()
: Group nodes by minimizing description length using igraph::cluster_infomap()
group_label_prop()
: Group nodes by propagating labels using igraph::cluster_label_prop()
group_leading_eigen()
: Group nodes based on the leading eigenvector of the modularity matrix using igraph::cluster_leading_eigen()
group_louvain()
: Group nodes by multilevel optimisation of modularity using igraph::cluster_louvain()
group_leiden()
: Group nodes according to the Leiden algorithm (igraph::cluster_leiden()
) which is similar, but more efficient and provides higher quality results than cluster_louvain()
group_optimal()
: Group nodes by optimising the moldularity score using igraph::cluster_optimal()
group_spinglass()
: Group nodes using simulated annealing with igraph::cluster_spinglass()
group_walktrap()
: Group nodes via short random walks using igraph::cluster_walktrap()
group_fluid()
: Group nodes by simulating fluid interactions on the graph topology using igraph::cluster_fluid_communities()
group_biconnected_component()
: Group edges by their membership of the maximal binconnected components using igraph::biconnected_components()
group_color()
: Groups nodes by their color using igraph::greedy_vertex_coloring()
. Be aware that this is not a clustering algorithm as coloring specifically provide a color to each node so that no neighbors have the same color
create_notable('tutte') %>%
activate(nodes) %>%
mutate(group = group_infomap())
#> # A tbl_graph: 46 nodes and 69 edges
#> #
#> # An undirected simple graph with 1 component
#> #
#> # Node Data: 46 × 1 (active)
#> group
#> <int>
#> 1 4
#> 2 1
#> 3 1
#> 4 1
#> 5 3
#> 6 3
#> 7 3
#> 8 2
#> 9 2
#> 10 2
#> # ℹ 36 more rows
#> #
#> # Edge Data: 69 × 2
#> from to
#> <int> <int>
#> 1 1 11
#> 2 1 12
#> 3 1 13
#> # ℹ 66 more rows