The valued constraint satisfaction problem (VCSP) provides a general framework for discrete optimization (see  for details). Informally, the VCSP framework deals with the minimization problem of a function represented as the sum of “small” arity functions, which are called cost functions
. It is known that various kinds of combinatorial optimization problems can be formulated in the VCSP framework. In general, the VCSP is NP-hard. An important line of research is to investigate what restrictions on classes of VCSP instances ensure polynomial time solvability. Two main types of VCSPs with restrictions arestructure-based VCSPs and language-based VCSPs (see e.g., [6, 36]). Structure-based VCSPs deal with restrictions on the hypergraph structure representing the appearance of variables in a given instance. For example, Gottlob–Greco–Scarcello  showed that, if the hypergraph corresponding to a VCSP instance has a bounded hypertree-width, then the instance can be solved in polynomial time. Language-based VCSPs deal with restrictions on cost functions that appear in a VCSP instance. Kolmogorov–Thapper–Živný  gave a precise characterization of tractable valued constraint languages via the basic LP relaxation. Kolmogorov–Krokhin–Rolínek  gave a dichotomy for all language-based VCSPs (see also [2, 35] for a dichotomy for all language-based CSPs).
Hybrid VCSPs, which deal with a combination of structure-based and language-based restrictions, have emerged recently . Among many kinds of hybrid restrictions, a binary VCSP, VCSP with only unary and binary cost functions, is a representative hybrid restriction that includes numerous fundamental optimization problems. Cooper–Živný  showed that if a given binary VCSP instance satisfies the joint winner property (JWP), then it can be minimized in polynomial time. The same authors classified in  the tractability of binary VCSP instances according to the concept of “triangle,” and showed that the only interesting tractable case is the one induced by the JWP (see also ). Furthermore, they introduced cross-free convexity as a generalization of JWP, and devised a polynomial-time minimization algorithm for cross-free convex instances , provided a “cross-free representation” of is given (see section 2.3 for detail).
In this paper, we introduce a novel tractability principle going beyond triangle and cross-free representation for binary VCSPs. A binary VCSP is formulated as follows, where () are finite sets.
Unary cost functions for and binary cost functions for .
Find a minimizer of defined by
Our tractability principle is built on discrete convex analysis (DCA) [25, 27], which is a theory of convex functions on discrete structures. In DCA, L-convexity and M-convexity play primary roles; the former is a generalization of submodularity, and the latter is a generalization of matroids. A variety of polynomially solvable problems in discrete optimization can be understood within the framework of L-convexity/M-convexity (see e.g., [27, 28, 29]). Recently, it has also turned out that discrete convexity is deeply linked to tractable classes of VCSPs. L-convexity is closely related to the tractability of language-based VCSPs. Various kinds of submodularity induce tractable classes of language-based VCSP instances , and a larger class of such submodularity can be understood as L-convexity on certain graph structures . On the other hand, Iwamasa–Murota–Živný  have pointed out that M-convexity plays a role in hybrid VCSPs. They revealed the reason for the tractability of a VCSP instance satisfying the JWP from a viewpoint of M-convexity. We here continue this line of research, and explore further applications of M-convexity in hybrid VCSPs.
where, for a function , the effective domain is denoted as , and is the
th unit vector.555Although M-convex functions are defined on in general, we only need functions on here. M-convex functions on are equivalent to the negative of valuated matroids introduced by Dress–Wenzel [9, 10]. An M-convex function can be minimized in a greedy fashion similarly to the greedy algorithm for matroids. Furthermore, a function that is representable as the sum of two M-convex functions is called M-convex. As a generalization of matroid intersection, the problem of minimizing an M-convex function, called the M-convex intersection problem, can also be solved in polynomial time if the value oracle of each constituent M-convex function is given [23, 24]; see also [26, Section 5.2]. Our proposed tractable class of VCSPs is based on this result.
Let us return to binary VCSPs. The starting observation for relating VCSP to DCA is that the objective function on can be regarded as a function on by the following correspondence between the domains:
With this correspondence, the minimization of can be transformed to that of . A binary VCSP instance is said to be M-representable if the function obtained from via the correspondence (2) is M-convex.
It is shown in  that a binary VCSP instance satisfying the JWP can be transformed to an M-representable instance,666In , a binary VCSP instance satisfying the JWP was transformed into the sum of two M-convex functions. It can be easily seen that this function can also be transformed into the sum of two M-convex functions. and two M-convex summands can be obtained in polynomial time. Here the following natural question arises: What binary VCSP instances are M-representable? In this paper, we give an algorithmic answer to this question by considering the following problem:
- Testing M-Representability
A binary VCSP instance .
Determine whether is M-representable or not. If is M-representable, obtain a decomposition of the function into two M-convex functions and , where is the function transformed from via (2).
We assume the following condition for an instance .
For all and , there is with .
This assumption is fairly reasonable, though checking whether a binary VCSP instance satisfies () is NP-hard in general (since it is equivalent to solving a general binary CSP). If all binary cost functions appearing in a given instance only take finite values, then the instance obviously satisfies (). Furthermore, every binary VCSP instance can be reduced to an instance satisfying () by redefining for and such that for all .
Our main result is the following:
For binary VCSP instances satisfying (), Testing M-Representability can be solved in time.
An M-convex function can be minimized in polynomial time if such a decomposition can be obtained in polynomial time. Thus we obtain the following corollary of Theorem 1.1.
An M-representable binary VCSP instance satisfying () can be minimized in polynomial time.
Our result provides us with cross-free representations, and presents a new tractable class of binary VCSPs that goes beyond JWP. A nice feature of our contribution is that the tractability based on M-representability is independent of a particular representation (1) of a given instance, while the tractability based on JWP or cross-free convexity depends on a representation; see section 2.3.
We also show the following theorem, which implies the NP-hardness of checking () when combined with Theorem 1.1.
Testing M-Representability is co-NP-hard.
Our approach to a polynomial-time algorithm for Testing M-Representability is outlined as follows:
We establish a unique representation theorem of M-convex functions arising from binary VCSP instances (Theorem 2.2).
With this result, our problem can be separated into two subproblems named Decomposition and Laminarization. The former is the problem of obtaining the unique representation of a given M-convex function, and the latter is the problem of making a laminar family from a given family of subsets by means of certain transformations.
A unique representation theorem (Theorem 2.2), a polynomial-time algorithm for Decomposition (Theorem 3.7), and that for Laminarization (Theorem 4.11) are the major results of this paper. In particular, Laminarization seems to be an interesting problem of combinatorial nature in its own right.
In Section 2, we introduce the representation theorem (Theorem 2.2) of quadratic M-convex functions arising from VCSP instances as well as the subproblems, Decomposition and Laminarization. We also prove Theorem 1.3. In Sections 3 and 4, we present polynomial-time algorithms for Decomposition and Laminarization, respectively.
Let , , , and denote the sets of integers, reals, nonnegative reals, and positive reals, respectively. In this paper, functions can take the infinite value , where , for , and . Let . For a positive integer , we define .
This is a full version of an extended abstract , which did not include all proofs and only dealt with finite-valued CSPs, with cost functions taking only finite real values. In this paper, we deal with general-valued CSPs, where the cost functions can take both finite real values and the infinite value ().
2 Towards testing M-representability
2.1 Representation theorem
We introduce a class of quadratic functions on that has a bijective correspondence to binary VCSP instances. Let be a partition of with for . We say that is a VCSP-quadratic function of type if is represented as
where and with for all for some . We assume for distinct .
Suppose that a binary VCSP instance of the form (1) is given, where we assume for distinct . The transformation of to based on (2) in Section 1 is formalized as follows. Choose a partition of with and a bijective correspondence . Define if corresponds to , if and correspond to and , respectively, and otherwise. Then the function in (3) is a VCSP-quadratic function of type . Note that condition () for is equivalent to the following condition for :
For all , there is with .
The class of M-convex VCSP-quadratic functions admits a decomposition into simpler functions . For , let be defined by
That is, is the sum of the distances from
to hyperplanesfor . In the following, we consider subsets with , and denote the family of such subsets by
In other words, if and only if for more than one .
A family is said to be laminar if , , or holds for all . For a subpartition of (which often corresponds to quadratic coefficients with the infinite value), a family is said to be -laminar if is laminar and all elements in are minimal in . Define by if and for each , and otherwise. Note that is the indicator function of . Then the following holds.
For any -laminar family and any positive weight , the function is M-convex.
We use the well-known fact that laminar convex functions are M-convex (see [27, Section 6.3]). Let the unary discrete convex function defined by for , and for . Then coincides with the function on . On the other hand, can be regarded as for a unary discrete convex function , where . Since is laminar, the function on is M-convex. Furthermore it is known [30, Theorem 3.1] that the restriction of an M-convex function to is M-convex if the effective domain is nonempty after the restriction. Hence is M-convex.
Our representation theorem (Theorem 2.2) says that an M-convex VCSP-quadratic function is always represented as the sum of and a linear function on . To state it precisely, there are substantial complications to be resolved. In our setting, we are given a VCSP-quadratic function of type , which is defined only on . It can happen that functions and are identical on (i.e., ) even when . Thus we have to make a judicious choice between them to demonstrate M-representability of .
To cope with such complications, we define an equivalence relation by: . For , let be the set of representatives (in ) of all elements in . The equivalence relation is extended to subsets of by: . A subset of is said to be -laminar if and there is a -laminar family with . A family is said to be -laminarizable if is -laminar. For simplicity, the equivalence class of is also denoted by , and a member of is also denoted by its representative .
Our first result is a representation theorem of M-convex functions. For a VCSP-quadratic function of type , let be a multipartite graph on with partition such that edge (, , ) exists if and only if . Define as the number of connected components of . A connected component with at least one edge is said to be non-isolated.
Let be a VCSP-quadratic function of type satisfying condition (), and be the set of non-isolated connected components of . Then is M-convex if and only if one of the following conditions (I) and (II) holds:
or , and .
, and there exist a -laminar family and a positive weight such that
where “” means a function for some and .
In the case of (II), and in (4) are uniquely determined.
2.2 Decomposition and Laminarization
A VCSP-quadratic function of type satisfying condition ().
Either detect the non-M-convexity of , or obtain some and satisfying
where is not required to be -laminar in general, but in case of M-convex , and should coincide, respectively, with and in (4).
We emphasize that Decomposition may possibly output the decomposition (5) even when the input is not M-convex, but if Decomposition detects the non-M-convexity then indeed the input is not M-convex.
Suppose that decomposition (5) is obtained after solving Decomposition. In this case we have at hand. Then we have to check for the -laminarizability of an arbitrarily chosen family with . This motivates us to consider the following problem.
and a subpartition of satisfying for each .
Determine whether there exists a -laminar family with . If it exists, obtain a -laminar family with .
Laminarization is a purely combinatorial problem on a set system. Indeed, the equivalence relation can be rephrased in a combinatorial way as follows. For , define
which is the union of contributing to nonlinearly. One can see the following.
For , if and only if .
Laminarization can be regarded as the problem of transforming a given family to a laminar family by repeating the following operation: replace with , , or with some satisfying . Figure 1 illustrates an example of the input (left) and an output (right) of Laminarization.
A decomposition into two M-convex functions and can be constructed from and found by Decomposition and Laminarization as and . By Lemma 2.1, is an M-convex function, and is a linear function on .
For the case of or , we devise an -time algorithm for checking the linearity of in Section 3.1. For the case of , we devise an -time algorithm for Decomposition in Section 3.2 and an -time algorithm for Laminarization in Section 4. Thus we obtain Theorem 1.1.
Our representation theorem (Theorem 2.2) and decomposition algorithm (in Section 3) are inspired by the polyhedral split decomposition due to Hirai . This general decomposition principle decomposes, by means of polyhedral geometry, a function on a finite set of points of into a sum of simpler functions, called split functions, and a residue term. Actually, (5) can be viewed as a specialization of the polyhedral split decomposition, where , and is a sum of split functions. We refer the reader to  for details.
2.3 Relation to other problems
Relation to JWP.
for all distinct and all . It is shown in  that if satisfies the JWP, then can be transformed, in polynomial time, into a function satisfying the JWP, , and
for any distinct , distinct , and distinct . A function with the JWP satisfying (7) is said to be Z-free. Z-free functions can be minimized in polynomial time. Thus, if satisfies the JWP, then can be minimized in polynomial time. It is shown in  that Z-free instances are M-representable.
The tractability based on M-representability depends solely on the function values, and is independent of how the function is given. Indeed, an M-representable instance can be characterized by the existence of a Z-free instance that satisfies for all . This stands in sharp contrast with the tractability based on the JWP, which depends heavily on the representation of . For example, let be a binary VCSP instance satisfying the JWP. By choosing a pair of distinct , , and arbitrarily, replace and by and , respectively. Then does not change but violates the JWP in general. Our result can explore such hidden M-convexity.
Relation to cross-free convexity.
A pair is said to be crossing if , , , and are all nonempty. A family is said to be cross-free if there is no crossing pair in . A (not necessarily binary) VCSP instance is said to be cross-free convex  if the function obtained from via the correspondence (2) can be represented as
where is a partition of with , is cross-free, and is a unary discrete convex function for each . Note that the polynomial-time minimization algorithm proposed in  for cross-free convex instances does not work unless the cross-free representation (8) is given.
Cross-free convexity is a special class of M-representability, where a (not necessarily binary) VCSP instance is M-representable if the function obtained from via the correspondence (2) is M-convex. Indeed, it is clear that is M-convex. Furthermore, by a similar argument to Lemma 2.1, the function is also M-convex on . Thus is M-convex, and hence, is M-representable.
Application to quadratic pseudo-Boolean function minimization.
Consider a pseudo-Boolean function represented as . For such , we define by
Then we have and for any . Hence minimizing is equivalent to minimizing .
Our result provides a new tractable class of quadratic pseudo-Boolean functions for minimization (see e.g., [1, 7]). We can regard as a function of the form (3) with the partition of given by for . Therefore, if is M-convex, then we can obtain two M-convex functions and satisfying by our proposed algorithm, and can minimize (and hence ) in polynomial time.
We give an example of such a minimizable function. Define by
Then with is represented as
By solving Decomposition, we obtain and , , , and , where we denote by for distinct . By solving Laminarization, we obtain a laminar family (see also Figure 1). Note and by Lemma 2.3. Thus is M-convex, and we obtain and . The two M-convex functions for are given by and a linear function on .
2.4 Proof of the characterization
In this subsection, we prove the characterization part of Theorem 2.2. That is, a VCSP-quadratic function of type satisfying condition () is M-convex if and only if is a linear function on (the case of or ), or (4) holds for some and (the case of ).
We first review fundamental facts about a general quadratic (not necessarily VCSP-quadratic) function represented as
where with , , and . We assume condition () for . Let be a graph on node set such that edge () exists if and only if . Note that is not a multipartite graph in general (unlike for a VCSP-quadratic function ). Define as the number of connected components of . Let be the node sets of the non-isolated connected components of . Let be the indicator function of , which is defined as for and for . Then the M-convexity of is characterized by the following lemma, which is a refinement of the result of  and .
Lemma 2.5 ([17, Theorem 3.1]).
A function of the form (9) satisfying condition () is M-convex if and only if each connected component of is a complete graph and one of the following conditions (I), (II), and (III) holds:
holds for every distinct .
holds for every , distinct , and distinct .
holds for every distinct , distinct , and distinct .
In particular, (II) or (III) holds if and only if is represented as .
Lemma 2.6 ([18, Lemma 8]).
satisfies the anti-ultrametric property if and only if there are a subpartition of , a -laminar family , and a positive weight such that
Quadratic coefficients are called -coefficients if [ for some ]. The following is a variation of a well-known technique (Farris transform) in phylogenetics  to transform a tree metric to a ultrametric, and follows from the validity of Algorithm I in .
Lemma 2.7 ().
Suppose that satisfies the anti-tree metric property. Let and for . Then satisfies the anti-ultrametric property and holds for any .
We now return to VCSP-quadratic functions. The following is a key proposition.
Let be a VCSP-quadratic function of type satisfying condition (), and be the set of non-isolated connected components (as a set of nodes) of . Then is M-convex if and only if one of the following conditions (I) and (II) holds:
or , and .
, and can be represented as
where are -coefficients satisfying the anti-ultrametric property.
Note that, for any subpartition of , is an M-convex function that can be represented as on