% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/structural-properties.R
\name{constraint}
\alias{constraint}
\title{Burt's constraint}
\usage{
constraint(graph, nodes = V(graph), weights = NULL)
}
\arguments{
\item{graph}{A graph object, the input graph.}

\item{nodes}{The vertices for which the constraint will be calculated.
Defaults to all vertices.}

\item{weights}{The weights of the edges. If this is \code{NULL} and there is
a \code{weight} edge attribute this is used. If there is no such edge
attribute all edges will have the same weight.}
}
\value{
A numeric vector of constraint scores
}
\description{
Given a graph, \code{constraint()} calculates Burt's constraint for each
vertex.
}
\details{
Burt's constraint is higher if ego has less, or mutually
stronger related (i.e. more redundant) contacts. Burt's measure of
constraint, \eqn{C_i}{C[i]}, of vertex \eqn{i}'s ego network
\eqn{V_i}{V[i]}, is defined for directed and valued graphs,
\deqn{C_i=\sum_{j \in V_i \setminus \{i\}} (p_{ij}+\sum_{q \in V_i
    \setminus \{i,j\}} p_{iq} p_{qj})^2}{
  C[i] = sum( [sum( p[i,j] + p[i,q] p[q,j], q in V[i], q != i,j )]^2, j in
  V[i], j != i).
}
for a graph of order (i.e. number of vertices) \eqn{N}, where
proportional tie strengths are defined as
\deqn{p_{ij} = \frac{a_{ij}+a_{ji}}{\sum_{k \in V_i \setminus \{i\}}(a_{ik}+a_{ki})},}{
  p[i,j]=(a[i,j]+a[j,i]) / sum(a[i,k]+a[k,i], k in V[i], k != i),
}
\eqn{a_{ij}}{a[i,j]} are elements of \eqn{A} and the latter being the
graph adjacency matrix. For isolated vertices, constraint is undefined.
}
\section{Related documentation in the C library}{
\href{https://igraph.org/c/html/0.10.17/igraph-Structural.html#igraph_constraint}{\code{constraint()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}
}

\examples{

g <- sample_gnp(20, 5 / 20)
constraint(g)

}
\references{
Burt, R.S. (2004). Structural holes and good ideas.
\emph{American Journal of Sociology} 110, 349-399.
}
\seealso{
Other structural.properties: 
\code{\link{bfs}()},
\code{\link{component_distribution}()},
\code{\link{connect}()},
\code{\link{coreness}()},
\code{\link{degree}()},
\code{\link{dfs}()},
\code{\link{distance_table}()},
\code{\link{edge_density}()},
\code{\link{feedback_arc_set}()},
\code{\link{feedback_vertex_set}()},
\code{\link{girth}()},
\code{\link{is_acyclic}()},
\code{\link{is_dag}()},
\code{\link{is_matching}()},
\code{\link{k_shortest_paths}()},
\code{\link{knn}()},
\code{\link{reciprocity}()},
\code{\link{subcomponent}()},
\code{\link{subgraph}()},
\code{\link{topo_sort}()},
\code{\link{transitivity}()},
\code{\link{unfold_tree}()},
\code{\link{which_multiple}()},
\code{\link{which_mutual}()}
}
\author{
Jeroen Bruggeman
(\url{https://sites.google.com/site/jebrug/jeroen-bruggeman-social-science})
and Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{structural.properties}
\keyword{graphs}
