1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cliques.R
\name{weighted_cliques}
\alias{weighted_cliques}
\title{Functions to find weighted cliques, i.e. vertex-weighted complete subgraphs in a graph}
\usage{
weighted_cliques(
graph,
vertex.weights = NULL,
min.weight = 0,
max.weight = 0,
maximal = FALSE
)
}
\arguments{
\item{graph}{The input graph, directed graphs will be considered as
undirected ones, multiple edges and loops are ignored.}
\item{vertex.weights}{Vertex weight vector. If the graph has a \code{weight}
vertex attribute, then this is used by default. If the graph does not have a
\code{weight} vertex attribute and this argument is \code{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.}
\item{min.weight}{Numeric constant, lower limit on the weight of the cliques to find.
\code{NULL} means no limit, i.e. it is the same as 0.}
\item{max.weight}{Numeric constant, upper limit on the weight of the cliques to find.
\code{NULL} means no limit.}
\item{maximal}{Specifies whether to look for all weighted cliques (\code{FALSE})
or only the maximal ones (\code{TRUE}).}
}
\value{
\code{weighted_cliques()} and \code{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 \code{\link[=V]{igraph.vs()}}.
\code{weighted_clique_num()} returns an integer scalar.
}
\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.
}
\details{
\code{weighted_cliques()} finds all complete subgraphs in the input graph,
obeying the weight limitations given in the \code{min} and \code{max}
arguments.
\code{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.
\code{weighted_clique_num()} calculates the weight of the largest weighted clique(s).
}
\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)
}
\seealso{
Other cliques:
\code{\link{cliques}()},
\code{\link{ivs}()}
}
\author{
Tamas Nepusz \email{ntamas@gmail.com} and Gabor Csardi
\email{csardi.gabor@gmail.com}
}
\concept{cliques}
\keyword{graphs}
\section{Related documentation in the C library}{\href{https://igraph.org/c/html/latest/igraph-Cliques.html#igraph_weighted_cliques}{\code{igraph_weighted_cliques()}}.}
|