In constraint satisfaction research of artificial intelligence and operations research, constraint graphs and hypergraphs are used to represent relations among constraints in a constraint satisfaction problem. A constraint graph is a special case of a factor graph, which allows for the existence of free variables.
The constraint hypergraph of a constraint satisfaction problem is a hypergraph in which hyper vertices correspond to the variables and the hyperedges correspond to the constraints. Two hyper vertices are in the same hyperedge if the two variables occur in the same constraint.
A simple way to represent the constraint hypergraph is by using a classical graph with the following properties:
Properties 1 and 2 define a bipartite graph. The definition of the hypergraph is obtained by defining the hypervertices as the variable-vertices and the hyperedges as the sets of variable-vertices connected to each constraint-vertex.
The primal constraint graph or simply primal graph (also the Gaifman graph) of a constraint satisfaction problem is the graph whose nodes are the variables of the problem and an edge joins a pair of variables if the two variables occur together in a constraint.
The primal constraint graph is in fact the primal graph of the constraint hypergraph.
The set of variables involved in a constraint is called the constraint scope. The dual constraint graph is the graph in which the vertices are all possible constraint scopes involved in the constraints of the problem and two vertices are connected by an edge if the corresponding scopes have common variables.