Available via license: CC BY 4.0
Content may be subject to copyright.
arXiv:1807.01079v1 [cs.AI] 3 Jul 2018
Stochastic Constraint Optimization using Propagation on Ordered Binary
Decision Diagrams
Anna L.D. Latour
LIACS, Leiden University
Leiden, The Netherlands
a.l.d.latour@liacs.leidenuniv.nl
Behrouz Babaki
´
Ecole Polytechnique de Montr´eal
Montreal, Canada
Siegfried Nijssen
ICTEAM, Universit´e catholique de Louvain
Louvain-la-Neuve, Belgium
siegfried.nijssen@uclouvain.be
Abstract
A number of problems in relational Artificial Intelligence can
be viewed as Stochastic Constraint Optimization Problems
(SCOPs). These are constraint optimization problems that in-
volve objectives or constraints with a stochastic component.
Building on the recently proposed language SC-ProbLog for
modeling SCOPs, we propose a new method for solving these
problems. Earlier methods used Probabilistic Logic Program-
ming (PLP) techniques to create Ordered Binary Decision Di-
agrams (OBDDs), which were decomposed into smaller con-
straints in order to exploit existing constraint programming
(CP) solvers. We argue that this approach has as drawback
that a decomposed representation of an OBDD does not guar-
antee domain consistency during search, and hence limits the
efficiency of the solver. For the specific case of monotonic
distributions, we suggest an alternative method for using CP
in SCOP, based on the development of a new propagator; we
show that this propagator is linear in the size of the OBDD,
and has the potential to be more efficient than the decompo-
sition method, as it maintains domain consistency.
1 Introduction
Making decisions under uncertainty is an important problem
in business, governance and science. Examples are found in
the fields of planning and scheduling, but also occur natu-
rally in fields like data science and bioinformatics. Many of
these problems are relational in nature.
Consider for example a viral marketing prob-
lem (Kempe, Kleinberg, and Tardos 2003). We are given
a social network of people (vertices) that have stochastic
relationships (edges). We want to rely on word-of-mouth
advertisement to turn acquaintances of people who buy our
product into new product-buyers. How can we minimize the
number of people we need to target directly in a marketing
campaign, while a minimum number of people is expected
to buy the product?
For another example we are given a network of stochas-
tic protein-gene interactions, with a list of (protein, gene)
pairs that are of interest to a biologist (Ourfali et al. 2007).
We wish to reduce the network to the part that is relevant
for modeling the interactions in that list. This is known as
atheory compression problem (De Raedt et al. 2008). How
can we maximize the sum of interaction probabilities for the
interesting pairs, while restricting the number of edges in-
cluded in the extracted network?
These two problems have common features. First, both
problems combine probabilistic networks and decision prob-
lems: we either decide who to target in our marketing cam-
paign, or which interactions to select from a protein-gene
interaction network. Second, they both involve an objective:
minimizing the number of people targeted for marketing and
maximizing a sum of probabilities, respectively. Third, they
both have to respect a constraint: either reaching a target
with respect to the expected number of product-buyers or
limiting the number of edges we select for our biologist.
The motivation for our ongoing work is that there is a
need for generic tools that can be used to model and solve
such problems. In our vision, these tools should combine the
state-of-the-art of probabilistic programming (PP) with con-
straint programming (CP). Probabilistic programming here
provides mechanisms for calculating probabilities of paths
in probabilistic networks. For making decisions, constraint
programming provides well-established technology.
Note that the stochastic constraint in the viral marketing
setting is a hard constraint on a sum of probabilities: we im-
pose a bound on the expected number of people buying the
product. This is a different setting than the soft constraints
that can be expressed using maximum a posteriori (MAP)
inference or maximum probability estimation (MPE).
Problems that involve these kinds of hard constraints
on probabilities are the focus of the field of stochas-
tic constraint programming (SCP) (Walsh 2002), which
combines probabilistic inference and constraint program-
ming to solve Stochastic Constraint Optimization Prob-
lems (SCOPs). SCP is closely related to chance constraint
programming (Charnes and Cooper 1959) and probabilistic
constraint programming (Tarim et al. 2009). However, these
tools do not provide a modeling language suitable for solv-
ing relational problems in a generic manner, and do not link
to the probabilistic programming literature.
Recently we proposed a new modeling language
and a new tool chain that addresses the problem
of modeling and solving relational SCOPs. This lan-
guage, Stochastic Constraint Probabilistic Prolog (SC-
ProbLog) (Latour et al. 2017), is based on (Decision The-
oretic) ProbLog (De Raedt, Kimmig, and Toivonen 2007;
Van den Broeck et al. 2010), and is therefore particularly
suited for modeling probabilistic paths. It extends ProbLog
with syntax for specifying SCOPs that are formulated on
probabilistic networks, and a tool chain for solving them.
Building on ProbLog, SC-ProbLog has functionality for
translating a Probabilistic Logic program in Boolean formu-
las, converting those formulas into Ordered Binary Decision
Diagrams (OBDDs) for tractable weighted model counting
(WMC), converting these OBDDs into Arithmetic Circuits
(ACs) and decomposing these into Mixed Integer Programs
(MIPs), which in turn serve as input for an off-the-shelve
MIP solver or CP solver that solves the SCOP.
The main contribution of this paper is a modification of
the last step in this pipeline. While in earlier work, constraint
optimization solvers were used as a black boxes on decom-
posed OBDDs, we propose to open the black box in this
work. We will demonstrate that the propagation that is used
in constraint satisfaction solvers, is not optimal for the con-
straints resulting from decomposition. Specifically, we will
show that constraint propagation is not domain consistent:
a search algorithm will branch over variables unnecessarily.
To address this flaw, we first introduce a na¨ıve propagation
algorithm over OBDDs that is domain consistent, and whose
worst case complexity is O(mn), where mis the size of
the OBDD and nis the number of decision variables. Note
that propagation is executed at every node of the search tree;
any reduction of O(mn)to a lower complexity affects each
node of the search tree. We will then show how to calcu-
late partial derivatives over the OBDDs (Darwiche 2003),
and use these derivatives to reduce the complexity of do-
main consistent propagation to O(m+n). Here we build on
earlier results for linear derivative computation on computa-
tional graphs (Iri 1984; Rote 1990) and computation graphs
for the deterministic Decomposable Negation Normal Form
(d-DNNF) (Darwiche 2001). This is a more efficient ap-
proach for the calculation of derivatives than the one pro-
posed in (Gutmann et al. 2008). Furthermore, we will argue
that our approach enables the creation of incremental con-
straint propagation algorithms; this allows for propagation
that is more efficient than O(m+n)in practice. Our method
assumes the stochastic constraint to have a particular mono-
tonic property, which we discuss in more detail in section 2.
In this paper, we first give a description of how typical
SCOPs can be modeled using SC-ProbLog, followed by a
discussion on how they can be solved. In section 4 we pro-
vide a short introduction to some key concepts of CP, which
we use in section 5 to introduce a proposal for an OBDD-
based stochastic constraint propagator for CP systems. We
conclude this work with an outlook on future research.
2 Modeling SCOPs with SC-ProbLog
The goal of SC-ProbLog (Latour et al. 2017) is to provide
a generic system for modeling and solving SCOPs. In this
section we give an example SCOP and explain how it can be
modeled using SC-ProbLog. Before we address that, let us
first define the kinds of SCOP that we consider in this work.
Problem Definition
We consider problems that are defined on two types of vari-
ables: decision variables and mutually independent stochas-
tic variables (denoted in this work as diand ti, respectively).
The problems involve a (stochastic) objective function and a
set of (stochastic) constraints, all of which can be expressed
in terms of these variables. We consider an optimization cri-
terion or constraint to be stochastic if its definition involves
stochastic variables. The aim is to find an assignment to the
decision variables (also referred to as a strategy) such that
the constraints are respected and the objective satisfied.
In this work we restrict our focus to variables that can
take Boolean values. We can assign a value of true or false
to decision variables, while the value of stochastic variables
is mutually independently determined by chance, character-
ized by an associated probability.
We consider a selection of constraints and objective func-
tions. In particular, we consider constraints that represent a
bound on expected utilities and objective functions that max-
imize or minimize an expected utility, e.g.:
X
i
rivi≥θstochastic constraint
max X
i
rivistochastic optimization criterion
(1)
where vieither represents the value of a decision variable di,
or a conditional probability P(φi|σ). Here φirepresents an
event, and the conditional probability represents the prob-
ability of that event happening (i.e. φievaluating to true),
given a strategy σ. With viwe associate a reward ri∈R+,
such that the expressions in equation (1) represent expected
utilities. For simplicity we will assume ri= 1 in this work,
but note that generalizing our approach to ri6= 1 is trivial.
Finally θis a threshold for the constraint.
Intuitively, in the optimization criterion of the viral mar-
keting problem, virepresents the probability of the event φi
that person ibuys a product, given a marketing strategy. The
marketing strategy is represented by decision variables di.
In this work we impose an additional monotonicity con-
dition on each probability P(φi|σ): we require that for
any strategy σ, switching the value of any decision variable
from false to true, will yield a probability that is not smaller:
P(φi|σ)≥P(φi|σ′), if σ′differs from σby one variable
that is true in σ′but false in σ. This condition is met in all
the example problems mentioned earlier.
In this work we will consider solving stochastic con-
straints rather than stochastic optimization criteria. How-
ever, it is easy to use our results in optimization as well: we
can solve a problem involving the optimization criterion in
equation (1) by repeatedly solving a constraint satisfaction
problem involving the constraint in equation (1), increasing
θeach time we have found a solution until we find a θfor
which there exists no solution.
An Example SCOP
Consider the network in figure 1, and suppose that infor-
mation can flow through each edge with a certain proba-
bility. We can formulate a theory compression problem as
described in section 1 on this network. Suppose we want to
maximize the sum of probabilities that information can flow
from ato cand from ato d, but we want to limit the number
of edges in the network, such that there are no more than 2
(cardinality constraint). We can model this as follows:
a
b
c
d
.7
.4
.8
.5
.1
Figure 1: A small network of four nodes (a,b,cand d) and
five undirected edges with associated probabilities.
• with each edge (i, j)in the network we associate a
stochastic variable tij and a decision variable dij ;
• with each variable tij we associate a probability p(tij );
• the events considered are φa→cand φa→d, which repre-
sent flow of information from ato cand from ato d;
• our objective is to find a σthat maximizes P(φa→c|σ)+
P(φa→d|σ);
• our constraint is Pkdk≤2.
Subsequently, we need to define the probability of events
φa→cand φa→d, given a strategy. Here, we use a WMC ap-
proach. We use a logical formula to represent when an event
is true, given an assignment to the decision variables and a
sample for the stochastic variables:
φa→c= (dac ∧tac)∨(dad ∧tad ∧dcd ∧tcd )∨
(dab ∧tab ∧dbd ∧tbd ∧dcd ∧tcd).(2)
Here, if tij and dij are true, then information can travel
through edge (i, j ). The logical formula represents all the
ways in which information can travel from ato c.
The probability P(φa→c|σ)is then defined as the sum
of the probabilities of all the (logical) models of this for-
mula. Given strategy σ= (dac =dad =dcd =dab =
dbd =⊤), one model is for instance tac =⊤, tab =tad =
tcd =tab =⊥, of which the probability is .4·(1 −.8) ·(1 −
.1) ·(1 −.5) ·(1 −.7); in principle, we sum the probabilities
of all such models to obtain P(φa→c|σ). Note that equa-
tion (2) has indeed a monotonic property: the more decision
variables are true, the higher the probability of the event is.
To program such a formulas in a generic manner, as well
as to define constraints and optimization criteria, we pro-
posed SC-ProbLog (Latour et al. 2017), which is also based
on weighted model counting. The following program in SC-
ProbLog would model the problem described above:
% Deterministic facts
1. node(a). node(b). node(c). node(d).
% Probabilistic facts
2. 0.7::t(a,b). 0.8::t(a,d). 0.5::t(b,d).
3. 0.4::t(a,c). 0.1::t(c,d).
% Decision variables
4. ?::d(a,b). ?::d(a,d). ?::d(b,d).
5. ?::d(a,c). ?::d(c,d).
% Relations
6. e(X,Y) :- t(X,Y), d(X,Y). e(Y,X) :- t(X,Y), d(X,Y).
7. path(X,Y) :- e(X,Y).
8. path(X,Y) :- X \= Y, e(X,Z), path(Z,Y).
% Constraints and optimization criteria
9. { d(X,Y) => 1 :- node(X), node(Y). } 2.
10. #maximize { path(a,c) => 1. path(a,d) => 1. }.
Here, we define the nodes in the network on line 1. Lines 2
and 3 associate the correct probability with each edge; these
are the stochastic variables. We define the decision variables
in lines 4 and 5. Edges are made undirected in line 6 and we
give the definition of a path in lines 7 and 8. In line 9 we de-
fine the constraint: we assign a utility of 1 to each decision
variable that is true. We also specify that we only allow de-
cision variables that reflect the edges between nodes that are
actually present in the network. Finally, line 10 represents
the optimization criterion: we assign a utility of 1 to there
being a path from ato cand to there being a path from ato
d. The utilities are summed and weighted by the actual prob-
ability of there being such paths. The logical formulas φa→c
and φa→dare constructed from the program by ProbLog.
An interesting feature of SC-ProbLog is that any problem
that does not contain negation or negative weights, repre-
sents a monotonic utility function. We restrict our attention
in this work to such functions.
In the next section we briefly discuss how to compute the
probabilities of such formulas efficiently and how to solve
the SCOP of which they are a part.
3 Solving SCOPs using CP
We assume that the reader is familiar with ProbLog1. In
case of absence of that familiarity, we refer the reader to
the literature, e.g. (De Raedt, Kimmig, and Toivonen 2007;
Fierens et al. 2015). We start this section with a short re-
cap of why ProbLog uses knowledge compilation to ob-
tain OBDDs; subsequently, we discuss how OBDDs can
be used to solve na¨ıvely the associated SCOP. Then
we discuss the earlier proposed tool chain for solving
SCOPs (Latour et al. 2017) and reflect on it.
From ProbLog to OBDD
Consider equation (2), and observe that computing
P(φa→c|σ)is complicated, as the different paths need to
be enumerated, but may also overlap. Therefore, computing
this probability involves a disjoint sum problem; in the gen-
eral case WMC is #P-complete (Roth 1996).
In ProbLog the tractability of this task is addressed by
compiling the formulas during a preprocessing phase into
a Sentential Decision Diagram (SDD) (Darwiche 2011) or
OBDD that allows for tractable WMC. The advantage of
this method is that, once this diagram is compiled, comput-
ing P(φ|σ)has a complexity that is linear in the size of
the diagram, thus reducing the complexity of the WMC task
(at a cost of having to preprocess the formula). This work
focuses on stochastic constraints that can be expressed by
OBDDs. We assume familiarity with OBDDs, for we will
only discuss a few of their characteristics here. For a more
extensive overview, see for example (Ben-Ari 2012).
To see how we can compute P(φ|σ)using an OBDD,
consider figure 2. It shows an OBDD that represents the
1https://dtai.cs.kuleuven.be/problog
P(φa→c)
tcd
dcd
dac
dac
tac
tac
tad
dad
dbd
tbd
tab
dab
0 1
.1
.9
.6
.4
.6
.4
.2
.8
.5
.5
.3.7
probability
Figure 2: An OBDD representing the probability that infor-
mation can travel from ato cin figure 1, i.e. the probabil-
ity that φa→cevaluates to true given any strategy σ. The
variable order corresponding to this OBDD is tcd < dcd <
dac < tac < tad < dad < dbd < tbd < tab < dab. Cir-
cular nodes represent stochastic variables, squares represent
decision variables. No specific strategy is reflected here.
probability of equation (2) evaluating to true. The weights
on the outgoing arcs of nodes that represent stochastic vari-
ables (those labeled with tij ) correspond to the probabil-
ity that that variable is true (for the solid, or hi, arcs) or
false (dashed, or lo, arcs). A strategy σis represented in the
OBDD by adding weights of 0 and 1 to the outgoing arcs of
the nodes corresponding to decision variables (those labeled
with dij ). For example: if we choose dac =⊥, we put a
weight of 0 on the outgoing hi arc of nodes labeled with dac
and weight 1 on their outgoing lo arcs.
Given a strategy σand arcs labeled accordingly, the
OBDD can straightforwardly be mapped to an Arithmethic
Circuit (AC). We can compute P(φa→c|σ)as follows. In a
bottom-up traversal, each OBDD node rtakes the value
v(r) = w(r)·vr++ (1 −w(r)) ·vr−,(3)
where r+(r−) is the hi (lo) child of r, i.e. the child con-
nected through the solid (dashed) outgoing arc of r;v(r) =
0for the negative leaf and v(r) = 1 for the positive leaf.
Observe that v(root) = P(φ|σ).
The complexity of evaluating P(φ|σ)is thus linear in
the size of the OBDD, but the number of strategies is 2n,
with nthe number of decision variables. The na¨ıve way of
solving a SCOP is to enumerate all possible strategies, use
the OBDD to evaluate the objective function and/or con-
straints for each strategy, evaluate possible other constraints,
and store the best feasible strategy found so far. Since the
number of strategies is exponential in the number of deci-
sion variables, this na¨ıve method does not scale well.
Solving SCOPs with the SC-ProbLog tool chain
Since SCOPs are constraint optimization problems, one ob-
vious approach to improving on the na¨ıve method is to lever-
age the state-of-the-art CP solvers that are available. The
tool chain described in (Latour et al. 2017) takes the OBDD
generated by ProbLog and instead of assigning weights to
the outgoing arcs of the nodes in the OBDD that represent
decision variables, converts the OBDD into an AC in which
those weights are present as boolean decision variables.
A constraint is imposed on the value of the AC, and the
then decomposed into a Mixed Integer Program (MIP); a set
of smaller constraints is constructed that represent the value
at each node of the OBDD according to equation (3). See
figure 3 for an example of what such a MIP may look like.
As mentioned in section 1, this method has a disadvan-
tage: during the search process, the solver cannot guarantee
domain consistency on the MIP representing the constraint.
We propose an alternative to this decomposition method in
section 5, but will first make the notion of some basic CP
concepts, including domain consistency, more concrete.
4 Introduction to Constraint Programming
Constraint programming is an area that studies the develop-
ment of modeling languages and solvers for constraint sat-
isfaction and optimization problems. Two processes form
the basis of Constraint Programming solvers: search and
propagation. We briefly discuss these concepts, for they
are critical to understanding our contributions in this work.
For a more comprehensive overview of CP, we refer the
reader to the literature, e.g. Principles of Constraint Pro-
gramming (Apt 2003). Then we continue with a discussion
of the relation between these principles and the circuit de-
composition method (Latour et al. 2017).
Search and Propagation
The search process is some structured method for exploring
the search space of the problem. In our SCOP setting, the
search space consists of all possible assignments to the (bi-
nary) decision variables, from which we need to find one that
satisfies the constraints and optimizes the objective function.
The details of the search process are outside the scope
of this work, but for search over binary variables the pro-
cess is roughly as follows. Initially, all variables are consid-
ered to be free or unassigned; they have a domain of {0,1}.
Then repeatedly a free decision variable dis selected, and
fixed to a value (either true or false). After each such assign-
ment, propagation is used to determine whether other vari-
ables can be fixed. Propagation is the process of updating
the domains of other free variables, making them reflect the
consequences of the assignments made to decision variables
(the fixed variables) so far. If propagation yields a contradic-
tion, the search backtracks over the last variable assignment;
otherwise, if a free variable remains, its value is fixed and the
search process continues.
The constraints of the problem guide the propagation. For
example: the problem may contain a cardinality constraint
that puts an upper bound of Non the number of variables
that can be set to true. Suppose that during search, variable
dis selected and fixed to true, becoming the Nth decision
variable to be true. Now we know that 1 should be removed
from the domain of each remaining free variable. This re-
duces the search space by making domains smaller.
During propagation two things can happen (possibly si-
multaneously). The first is that the domain of a free variable
becomes empty. This means there is no solution given the
current partial assignment to decision variables, so we must
backtrack to explore a different part of the search space. Al-
ternatively the domain size of a free variable is reduced to
1, leaving only one possible value for that variable (given
the current partial assignment). Such a variable can then be
fixed and removed from the set of free variables, reducing
the search space by reducing the number of free variables.
There are myriad optimizations for both search and propa-
gation, but these are outside the scope of this work. Observe
that both the nature of the search and of the propagation de-
pend on the type of variables and on the nature of the con-
straint. In this work we focus on developing a propagator
that enforces domain consistency on OBDDs.
Domain Consistency
An important notion in propagation is that of domain con-
sistency. We define it as follows:
Definition 1. Let ϕ(x1,...,xn)be a constraint over
boolean variables x1,...,xn. Furthermore, let σ′be par-
tial assignment to the variables x1, . . . , xn. Then a propa-
gator for constraint ϕis domain consistent if for any σ′this
propagator calculates a new partial assignment σsatisfying
these conditions: (1) σextends σ′, (2) for all variables vnot
assigned by σ, both the partial assignments σ∪ {v7→ ⊥}
and σ∪ {v7→ ⊤} can be extended to a complete assignment
that satisfies the constraint ϕ.
In other words, after domain consistent propagation for a
constraint, all values have been removed from all variable
domains that cannot be part of a solution for that constraint.
We illustrate this notion with an example. A standard
practice in CP is to call the propagator before the search
starts, in order to make the initial domains consistent with
the constraint, and, ideally, detect the variables that are
forced to a specific value by the constraint.
Consider the OBDD in figure 3 and the associated con-
straint P(φ|σ)≥.4. Observe that the four possible strate-
gies yield the following conditional probabilities, which are
monotonic in the decision variables:
P(φ|x=y= 0) = 0 P(φ|x= 1, y = 0) = .3
P(φ|x=y= 1) = .6P(φ|x= 0, y = 1) = .6
From this we conclude that only those strategies in which
y= 1 can possibly satisfy the constraint. A propagator that
ensures domain consistency will detect this before the start
of the search and fix yto 1.
The circuit decomposition method translates this con-
straint on the OBDD in a CP model that is also given in
figure 3. Suppose a propagator is called on this decomposed
model, before the search starts. This propagator may start
by trying to infer the minimum value v(y1)needs to take if
P(φ)
x
y1y2
0 1
.9
.1
.4
.6
.7
.3
P(φ|σ)≥.4
.1v(y1) + .9v(x)≥.4
v(x) = (1 −x)v(y1) + xv(y2)
v(y1) = .6y
v(y2) = .6y+.3(1 −y)
x, y ∈ {0,1}
0≤P(φ|σ)≤.6
0≤v(x)≤.6
0≤v(y1)≤.6
.3≤v(y2)≤.6
Figure 3: A small OBDD (left) with three stochastic vari-
ables and two decision variables. The two nodes correspond-
ing to decision variable yare indexed for clarity. The MIP
on the right is constructed using equation (3).
v(x)takes its maximum possible value. To do this, the prop-
agator assumes for a moment that v(x) = .6holds. Now
it can infer that, in order for the constraint to be satisfied,
v(y1)≥(.4−.9·.6)/.1=−1.4should hold. Unfortunately,
this does not tell us anything, for we already knew that the
domain of yis {0,1}and thus does not include −1.4. Based
on this, we cannot remove 0 from the domain of y. Repeating
this procedure to determine a bound for v(x)by assuming
v(y1)takes it maximum value, and from there continuing to
determine bounds for v(y1)and v(y2)does not yield con-
clusive evidence to deduct that ymust be fixed to 1, either.
This shortcoming of the circuit decomposition method
causes a lack of efficiency, since the search space is not re-
duced as much as possible. In the next section we introduce a
propagator for OBDDs that does ensure domain consistency.
5 Approach
We intend to improve upon the existing circuit decomposi-
tion approach for solving SCOPs, by allowing an OBDD-
based constraint to be added directly to a CP solver, rather
than decomposed into a multitude of (linear) constraints. In
order to achieve this, we need to introduce a propagator for
OBDDs. As discussed in section 4, this propagator should
guarantee domain consistency in the OBDD.
In this section we will first introduce a na¨ıve approach for
such a domain consistent propagator. Subsequently, we will
show how to obtain a better worst-case complexity by using
the idea of derivatives.
Na¨
ıve Propagator
As discussed earlier, we can calculate the quality of any
strategy with an algorithm that traverses the OBDD bottom-
up, using equation (3).
For the creation of a domain consistent propagator, our
first important observation is that our scoring function is
monotonic; hence, the largest possible score is obtained by
assigning the value true to all free decision variables.
The idea behind domain consistent propagation is to re-
peat the following process for each free decision variable d:
1. fix variable dto the value false;
2. fix all other free variables to the value true;
3. calculate the score for the resulting assignment;
4. if the score is lower than the desired threshold, remove the
value false from the domain of variable d.
By construction, this process is domain consistent.
Let nbe the number of free decision variables, and let m
be the size of the OBDD. Then the complexity of the algo-
rithm above is O(mn): for every free variable we perform a
bottom-up traversal of the OBDD. Given that propagation is
the most computationally intensive part of search algorithms
under our constraint, it is important to obtain a better perfor-
mance. We will improve this complexity to O(n+m), using
an approach similar to that for d-DNNFs (Darwiche 2001).
Overview of our Propagator
The key idea behind our improved propagator is that we cal-
culate a derivative
∂f (d, σ′\d)
∂d =f(σ′)−f(d=⊥, σ′\d)(4)
for every free decision variable d. Here, σ′represents a full
assignment to all decision variables. In this assignment, ev-
ery free variable is assumed to have the value true. Function
frepresents the function defined by equation (3) on the root
of the OBDD. Hence, f(σ′)represents the best score cur-
rently possible, in which all free variables have been given
the value ⊤;f(d=⊥, σ′\d)represents the assignment in
which the value for variable dhas been switched to ⊥.
We use the derivative to remove the value false from the
domains of variables that do not meet this requirement:
f(σ′)−∂f (d, σ′\d)
∂d ≥θ. (5)
Clearly, the main question becomes how to calculate
∂f (d, σ′\d)/∂ d for all free variables efficiently. Here,
we will build on ideas introduced by Darwiche in
2003 (Darwiche 2003) to build an O(m)algorithm. This al-
gorithm adapts the ideas of Darwiche to our specific context;
we will argue that this enables us to perform propagation for
monotonic constraints in an incremental manner, effectively
making the complexity lower than O(m).
Calculating the Derivative
We first need to define the concept of path weight:
Definition 2. Let rmbe a node labeled with variable xmin
an OBDD with variable order x1< . . . < xn. We define the
path weight of rm:
π(rm) = X
ℓ∈LrmY
ri∈ℓ
ui,(6)
where ℓis a path from the root of the OBDD to rm, and Lrm
is the set of all such paths that are valid. A path is valid if it
does not include
• the hi arc from a node labeled with a decision variable
that is false and
• the lo arc from a node labeled with a decision variable
that is true or free.
In other words: we take paths that reflect the current partial
assignment, and take the hi arc from free decision nodes.
In our definition of ui, we use ui= 1 for the outgoing
arcs of decision nodes that can be part of a valid path.
For the outgoing arcs of stochastic nodes labeled with a
stochastic variable xithat has weight wias defined in the
ProbLog program, we use:
ui=wiif we take the hi arc of ri;
1−wiif we take the lo arc of ri.(7)
Note that the path weight π(rm)is expressed in terms of
variables xi< xmonly.
An example: if we were to fix dcd and dac to true in fig-
ure 2, then the path weight of the node labeled with tad
would be π(rtad ) = .1·1·(1 ·.6 + 0) = .06.
Our algorithm is based on the observation that derivatives
can be calculated using the following equation:
Theorem 1. The derivative of the OBDD with respect to a
decision variable can be calculated as follows:
∂f (d, σ′\d)
∂d =X
rd∈OBDDd
π(rd)v(r+
d)−v(r−
d),(8)
where OBDDdrepresents all nodes in the OBDD labeled
with variable d.
Proof. Let f(x1,...,xn)be the polynomial associated with
an OBDD with variable order x1< . . . < xn. Let ribe a
node labeled with xiand let wibe the positive weight of that
variable. Observe that for any variable xm(with x1≤xm≤
xn) we can write fas
f(x1,...,xm,...,xn) =
X
rm∈OBDDm
π(rm)wmv(r+
m) + (1 −wm)v(r−
m),(9)
where the values of the the hi and lo child of rmare v(x+
m)
and v(x−
m), respectively, following equation (3). Recall that
in the expression of the path weight of rm,wmdoes not
occur. Note also that v(r+
m)and v(r−
m)are expressed in vari-
ables xi> xmonly. The derivative of this formula (with
respect to wm) corresponds to the claim in the theorem.
We use the observation above to create an O(m)algo-
rithm for calculating all derivatives in two stages:
• a top-down pass over the complete OBDD for calculating
all path weights;
• a bottom-up pass for calculating the values for all nodes in
the complete OBDD, calculating the derivatives for each
variable in the process.
The pseudo codes for these passes are given in algo-
rithms 1 and 2, respectively.
Once these passes are completed, we can recompute the
derivatives for all decision variables that are still free, and
Algorithm 1 Compute path weights.
1: π(root)←1
2: for ri∈OBDD and ri6=root do π(ri)←0end for
3: for each internal node ri∈OBDD (in topological or-
der) do
4: if ricorresponds to decision variable dithen
5: if diis true or free then
6: πr+
i←πr+
i+π(ri)
7: else
8: πr−
i←πr−
i+π(ri)
9: else
10: πr+
i←πr+
i+wiπ(ri)
11: πr−
i←πr−
i+ (1 −wi)π(ri)
Algorithm 2 Compute values.
1: v(0) ←0,v(1) ←1⊲Leaf nodes
2: for each internal node ri∈OBDD (in reversed topo-
logical order) do
3: if ricorresponds to decision variable dithen
4: if diis true or free then
5: v(ri)←vr+
i
6: else
7: v(ri)←vr−
i
8: else
9: v(ri)←wivr+
i+ (1 −wi)vr−
i
evaluate equation (5) for each of those to see if we can re-
move false from their domain, such that we can enforce do-
main consistency. The pseudo code for this is provided in al-
gorithm 3 for clarity, but can be integrated with algorithm 2.
Clearly, the overall calculation finishes in O(n+m)time.
Traversing Part of the OBDD
For efficient propagation, it is desirable that the complex-
ity of the algorithm above can be reduced more; we should
avoid traversing unnecessary parts of the OBDD as much as
possible. Building on the ideas presented earlier, some ob-
servations allow for more efficient propagation in practice.
As we observed before, the expression for the path weight
of an OBDD node labeled with variable xm(equation (6))
only contains variables xi< xm. We thus conclude that
fixing a decision variable dcan only affect the path weights
of nodes below the nodes labeled with that variable d.
Moreover: because we take the hi arc both from decision
nodes that are free and from those that are true, path weights
below free decision nodes are not changed at all when we fix
a decision node to true.
Therefore: whenever we fix a decision variable, our prop-
agator only needs to call algorithm 1 if we fix it to false, and
even then it only has to traverse the part of the diagram that
is below the nodes labeled with that decision variable.
A similar argument holds for the values of the OBDD
nodes. Since they are computed in a bottom-up traversal of
the OBDD, fixing a variable can only affect the values of
the nodes labeled with that variable themselves, and those
Algorithm 3 Enforce domain consistency.
1: for each free variable ddo
2: ∆d←0
3: for each node r∈OBDDddo
4: ∆d←∆d+π(r)·(v(r+)−v(r−))
5: if v(root)−∆d< θ then
6: remove false from domain of d
above them in the diagram. Again: only fixing a variable to
false actually requires the propagator to update values at all.
We can further narrow down the parts of the diagram that
need to be considered. Consider the decision variable that
occurs closest to the root of the OBDD. We do not need to
maintain the values for any of the nodes in the OBDD above
it, as we will never need to calculate the derivative for any
variable in this part of the diagram. Similarly, consider the
variable closest to the leaves; we do not need to maintain
path weights for its descendants either. It can be shown that
by only maintaining the part of the OBDD between two bor-
ders (the active part of the OBDD), one can calculate the
derivatives exactly, as well as calculate the true value of the
optimization criterion without propagating towards the root.
6 Conclusion and Outlook
Many problems in AI can be seen as SCOPs. In
this work we proposed a new method for solving
SCOPs that are modeled using PLP techniques, specifi-
cally: SC-Problog (De Raedt, Kimmig, and Toivonen 2007;
Latour et al. 2017). In SC-ProbLog, we can convert the
SCOP’s stochastic constraints into constraints on OBDDs.
This work was motivated by the observation that an earlier
approach was not built on domain consistent propagation.
We sketched a propagator for such OBDD constraints that
does enforce domain consistency in linear time.
We limited our attention to a representation of distribu-
tions in OBDDs. The advantage of this representation is that
we can clearly identify parts of the diagram above and be-
low a decision variable; we argued that this can be used to
limit the active part of the diagram and to limit which type
of calculation is performed on which part of the diagram.
Several details were omitted from this paper. We did not
include extensive details regarding the maintenance of active
parts of OBDDs or the incremental calculation of optimiza-
tion criteria. Furthermore, we did not include an extension
to constraints on sums of probabilities, or to constraints of
the form P(φ|σ)≤θ.
Concrete next steps are the implementation of our ap-
proach, its evaluation on data, a comparison of different ap-
proaches for maintaining active parts of OBDDs, and its ex-
tension to other types of diagrams.
Acknowledgements. This research was supported by the
Netherlands Organisation for Scientific Research (NWO).
Behrouz Babaki is supported by a postdoctoral scholarship
from IVADO.
References
[Apt 2003] Apt, K. 2003. Principles of Constraint Program-
ming. Cambridge: Cambridge University Press.
[Ben-Ari 2012] Ben-Ari, M. 2012. Mathematical Logic for
Computer Science. Springer Publishing Company, Incorpo-
rated, 3rd edition.
[Charnes and Cooper 1959] Charnes, A., and Cooper, W. W.
1959. Chance-Constrained Programming. Management Sci-
ence 6(1):73–79.
[Darwiche 2001] Darwiche, A. 2001. On the Tractable
Counting of Theory Models and its Application to Belief
Revision and Truth Maintenance. Journal of Applied Non-
Classical Logics 11(1-2):11–34.
[Darwiche 2003] Darwiche, A. 2003. A differential ap-
proach to inference in Bayesian networks. Journal of the
ACM 50(3):280–305.
[Darwiche 2011] Darwiche, A. 2011. SDD: A new canonical
representation of propositional knowledge bases. In Pro-
ceedings of the Twenty-Second International Joint Confer-
ence on Artificial Intelligence, volume 2 of IJCAI’11, 819–
826.
[De Raedt et al. 2008] De Raedt, L.; Kersting, K.; Kimmig,
A.; Revoredo, K.; and Toivonen, H. 2008. Compress-
ing probabilistic Prolog programs. Machine Learning 70(2-
3):151–168.
[De Raedt, Kimmig, and Toivonen 2007] De Raedt, L.;
Kimmig, A.; and Toivonen, H. 2007. ProbLog: A Prob-
abilistic Prolog and Its Application in Link Discovery. In
Proceedings of the Twentieth International Joint Conference
on Artifical Intelligence, volume 7 of IJCAI’07, 2462–2467.
[Fierens et al. 2015] Fierens, D.; Van den Broeck, G.;
Renkens, J.; Shterionov, D.; Gutmann, B.; Thon, I.;
Janssens, G.; and De Raedt, L. 2015. Inference and learn-
ing in probabilistic logic programs using weighted Boolean
formulas. Theory and Practice of Logic Programming
15(03):358–401.
[Gutmann et al. 2008] Gutmann, B.; Kimmig, A.; Kersting,
K.; and De Raedt, L. 2008. Parameter Learning in Prob-
abilistic Databases: A Least Squares Approach. Springer,
Berlin, Heidelberg. 473–488.
[Iri 1984] Iri, M. 1984. Simultaneous computation of func-
tions, partial derivatives and estimates of rounding errors:
Complexity and practicality. Japan Journal of Applied
Mathematics 1(2):223–252.
[Kempe, Kleinberg, and Tardos 2003] Kempe, D.; Klein-
berg, J.; and Tardos, ´
E. 2003. Maximizing the Spread of
Influence Through a Social Network. In Proceedings of the
Ninth ACM SIGKDD International Conference on Knowl-
edge Discovery and Data Mining, KDD ’03, 137–146. New
York, NY, USA: ACM.
[Latour et al. 2017] Latour, A. L. D.; Babaki, B.; Dries, A.;
Kimmig, A.; Van Den Broeck, G.; and Nijssen, S. 2017.
Combining Stochastic Constraint Optimization and Proba-
bilistic Programming. In Beck, J. C., ed., Principles and
Practice of Constraint Programming: 23rd International
Conference, CP 2017, Melbourne, VIC, Australia, August 28
– September 1, 2017, Proceedings. Cham: Springer Interna-
tional Publishing. 495–511.
[Ourfali et al. 2007] Ourfali, O.; Shlomi, T.; Ideker, T.; Rup-
pin, E.; and Sharan, R. 2007. SPINE: a framework for
signaling-regulatory pathway inference from cause-effect
experiments. Bioinformatics 23(13):i359—-i366.
[Rote 1990] Rote, G. 1990. Path Problems in Graphs.
Springer, Vienna. 155–189.
[Roth 1996] Roth, D. 1996. On the Hardness of Approxi-
mate Reasoning. In Artif. Intell., volume 82, 273–302. Es-
sex, UK: Elsevier Science Publishers Ltd.
[Tarim et al. 2009] Tarim, S. A.; Hnich, B.; Prestwich, S.;
and Rossi, R. 2009. Finding reliable solutions: event-driven
probabilistic constraint programming. Annals of Operations
Research 171(1):77–99.
[Van den Broeck et al. 2010] Van den Broeck, G.; Thon, I.;
Van Otterlo, M.; and De Raedt, L. 2010. DTProbLog: A
decision-theoretic probabilistic Prolog. In Proceedings of
the twenty-fourth AAAI conference on artificial intelligence,
1217–1222. AAAI Press.
[Walsh 2002] Walsh, T. 2002. Stochastic constraint pro-
gramming. In ECAI, volume 2, 111–115.