Formulating Constraint Satisfaction Problems on Part-Whole Relations : The Case of Automatic Musical Harmonization

We address the issue of formulating constraint problems in structured domains, and focus on the exploitation of partwhole relations. We describe and compare two approaches in problem formulation in this context; one using a flattened representation of domains, and one using a naturally occurring part-whole relation. We show that the second approach may be much more eff icient than the flattened representation, thanks to a judicious partitioning of the constraint problem in several phases. We give a theoretical measure of the respective complexities of the two approaches, and ill ustrate our result on a diff icult and naturally structured musical problem: automatic harmonization of melodies. The resulting system outperforms previous attempts on the same problem. Finally, we propose other applications of our approach for generating automatically musical programs. 1. FORMULATION OF CONSTRAINT SATISFACTION PROBLEMS Constraint satisfaction techniques (CSP) have been increasingly used for solving difficult combinatorial problems recently, thanks to the availabilit y of efficient algorithms and data structures. CSPs are attracting because they allow problems to be stated in a simple and declarative way, as 1) a set of variables, having predetermined finite domains, and 2) a set of constraints, usually taken off-the-shelf from a constraint library, which hold their own solving mechanism. Today, most of the problems solved by these techniques traditionally belong to the field of operational research, and combinatorial optimization. These problems are usually formulated using some kind of mathematical representation, such as graph theory. A typical consequence of this formulation is that the domains of constrained variables are “flattened out” , and the whole problem is stated in terms of atomic values, such as integer or real numbers. Somehow, the semantics of the domains is integrally represented by the constraints, and the domains of variables have no direct interpretation. This approach is efficient in cases when the resulting constraint systems contains only well known constraints, such as basic arithmetic constraints or combinations thereof, or so-called global constraints, for which generic, parameterized solving algorithms were developed [Beldiceanu and Contejean 94]. This typically occurs for problems which have already been the subject of formalization in fields such as operational research: scheduling, layout cutting, etc. We believe CSP techniques can be successfully applied to many other fields, where 1) problems have not been formalized mathematically, and 2) domains are naturally structured. This is typically the case in multimedia, where there is a growing pool of new problems which call for efficient solving techniques, and in which the underlying ontologies are not easily reduced to mathematical entities such as integer or real numbers. However, applying CSP techniques in this context raises an important formulation issue, by definition, since the reduction of problems to a flattened representation is either impossible or unnatural. In this context, we are interested in the formulation of constraint problems which allows to 1) take into account underlying ontologies of structured objects, and 2) give rise to efficient solving by traditional CSP techniques. This is typically the case of the automatic harmonization problem, on which we will concentrate in this paper. However, this paper is not specifically about harmonization, but about formulation of constraint problems in naturally structured domains. In Section 2 we will describe precisely the automatic harmonization problem, and review preceding approaches for solving it. In Section 3 we will describe our approach, based on a formulation of the problem in a non-flattened space, and compare it to the equivalent flattened formulation, including an evaluation of its theoretical complexity. 1 SONY CSL-Paris, 6 rue Amyot, 75005 Paris, France, pachet@csl.sony. fr 2 LIP6, Université Paris 6, E-mail: roy@poleia.lip6. fr