weighted_cliques: Functions to find weighted cliques, i.e. vertex-weighted...

weighted_cliquesR Documentation

Functions to find weighted cliques, i.e. vertex-weighted complete subgraphs in a graph

Description

These functions find all, the largest or all the maximal weighted cliques in an undirected graph. The weight of a clique is the sum of the weights of its vertices.

Usage

weighted_cliques(
  graph,
  vertex.weights = NULL,
  min.weight = 0,
  max.weight = 0,
  maximal = FALSE
)

Arguments

graph

The input graph, directed graphs will be considered as undirected ones, multiple edges and loops are ignored.

vertex.weights

Vertex weight vector. If the graph has a weight vertex attribute, then this is used by default. If the graph does not have a weight vertex attribute and this argument is NULL, then every vertex is assumed to have a weight of 1. Note that the current implementation of the weighted clique finder supports positive integer weights only.

min.weight

Numeric constant, lower limit on the weight of the cliques to find. NULL means no limit, i.e. it is the same as 0.

max.weight

Numeric constant, upper limit on the weight of the cliques to find. NULL means no limit.

maximal

Specifies whether to look for all weighted cliques (FALSE) or only the maximal ones (TRUE).

Details

weighted_cliques() finds all complete subgraphs in the input graph, obeying the weight limitations given in the min and max arguments.

largest_weighted_cliques() finds all largest weighted cliques in the input graph. A clique is largest if there is no other clique whose total weight is larger than the weight of this clique.

weighted_clique_num() calculates the weight of the largest weighted clique(s).

Value

weighted_cliques() and largest_weighted_cliques() return a list containing numeric vectors of vertex IDs. Each list element is a weighted clique, i.e. a vertex sequence of class igraph.vs().

weighted_clique_num() returns an integer scalar.

Related documentation in the C library

igraph_weighted_cliques().

Author(s)

Tamas Nepusz ntamas@gmail.com and Gabor Csardi csardi.gabor@gmail.com

See Also

Other cliques: cliques(), ivs()

Examples


g <- make_graph("zachary")
V(g)$weight <- 1
V(g)[c(1, 2, 3, 4, 14)]$weight <- 3
weighted_cliques(g)
weighted_cliques(g, maximal = TRUE)
largest_weighted_cliques(g)
weighted_clique_num(g)

igraph documentation built on Oct. 20, 2024, 1:06 a.m.