Next Article in Journal
Gradient Systems and Asymmetric Relaxations in View of Riemannian Geometry
Next Article in Special Issue
Causal Structure Learning Assumptions Shape Counterfactual Safety: Expert-Guided Constraints vs. Data-Driven DAGs with Probabilistic Logic Twin Networks
Previous Article in Journal
Effective Mode Approximation for Probabilistic Verification of Collective Hamiltonians in Large Continuous-Variable Quantum Systems
Previous Article in Special Issue
Clustering-Conditioned Granger Causality Between GDP Growth and Private Financing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Algorithmic Treatment of Causal Unit Selection †

Computer Science Department, University of California, Los Angeles (UCLA), Los Angeles, CA 90095, USA
*
Author to whom correspondence should be addressed.
This article is a revised and expanded version of two conference papers: 1. Huang, H.; Darwiche, A. An Algorithm and Complexity Results for Causal Unit Selection. In Proceedings of the 2nd Conference on Causal Learning and Reasoning, Tübingen, Germany, 11–14 April 2023; 2. Huang, H.; Darwiche, A. Causal Unit Selection using Tractable Arithmetic Circuits. In Proceedings of the International FLAIRS Conference Proceedings, Sandestin Beach, FL, USA, 19–21 May 2024, Vol. 37.
Entropy 2026, 28(5), 515; https://doi.org/10.3390/e28050515
Submission received: 19 February 2026 / Revised: 22 April 2026 / Accepted: 24 April 2026 / Published: 2 May 2026
(This article belongs to the Special Issue Causal Graphical Models and Their Applications, 2nd Edition)

Abstract

The problem of optimizing a causal objective function emerged in recent work, where the behavior of objects needs to be expressed in terms of interventional or counterfactual probabilities. A key example is the unit selection problem introduced by Li and Pearl, where the goal is to find the individuals who maximize a benefit function that scores their characteristics (called units) using counterfactual probabilities. Previous work on unit selection focused mainly on this specific objective function and on identifying its value using bounds. We complement this line of work by developing a theory that treats unit selection as a computational problem, assuming a fully specified causal model is available and a more general class of objective functions. At the core of our treatment is a novel reduction that transforms the computation of a broad class of causal objective functions into a classical associational probability on a meta-model called the objective model. Based on this reduction, we propose the first exact algorithm for finding the optimal units by applying Variable Elimination (VE) on the objective model. We then characterize the complexity of causal unit selection, showing that it is NP PP -complete, and that the runtime of VE must be exponential in the constrained treewidth of the objective model, which is larger and denser than the original input model. To address this challenge, we compile the objective model into a special class of tractable arithmetic circuits, allowing the optimal units to be computed in time linear in the circuit size. Finally, we present experiments demonstrating the substantial speedup from the circuit-based method over the VE-based method, and the speedup from the VE-based method over a baseline search method, together with a case study on a real-world ecology problem.

1. Introduction

A theory of causality has emerged over the last few decades based on two parallel hierarchies, an information hierarchy and a reasoning hierarchy, often called the causal hierarchy [1,2,3]. On the reasoning side, this theory has crystallized three levels of reasoning with increased sophistication and proximity to human reasoning: associational, interventional [1,4,5,6,7,8] and counterfactual [1,9,10,11,12], which are exemplified by the following canonical probabilities. Associational  Pr ( y | x ) : Probability of y given that x was observed (e.g., the probability that a patient has the flu given they have a fever). Interventional  Pr ( y | do ( x ) ) or Pr ( y x ) : Probability of y given that x was established by an intervention, which is different from Pr ( y | x ) (e.g., seeing the barometer fall tells us about the weather, but moving the barometer needle will not bring rain). Counterfactual  Pr ( y x | y , x ) : Probability of y if we were to establish x given that neither x nor y are true (e.g., the probability that a patient who did not take a vaccine and became infected, would not have been infected had they been vaccinated). On the information side, these forms of reasoning require different levels of knowledge, encoded as associational, causal, and functional (mechanistic) models, with each class of models containing more information than the preceding one. In the framework of probabilistic graphical models [13], such knowledge is encoded by Bayesian networks [14,15], causal Bayesian networks [1,6,16] and functional Bayesian networks [17], also known as structural causal models (SCMs).
Reasoning about the behavior of objects under interventional or counterfactual conditions has become increasingly important across a variety of fields, including marketing, health science, recommendation systems, planning, and multi-agent decision-making. In many such settings, one would like not only to predict an object’s response to a particular action or intervention, but also to identify which objects (e.g., people, agents, regions, policies, decisions) are most desirable under a causal evaluation criterion. This has led to growing interest in optimizing causal objective functions, which assign a score to objects based on expressions that involve interventional or counterfactual probabilities.
Consider a motivating example in which a video-sharing platform wants to decide whether recommending a video to certain users is worthwhile. The action X is whether the video is shown to the user, and the target Y is whether the user watches it. One can use counterfactuals to categorize users into four different behavioral types: responder, always-taker, always-denier, and contrarian, based on their response with the recommendation ( Y x ) and without the recommendation ( Y x ). A responder ( y x , y x ) would watch the video if it is recommended and would not watch otherwise. An always-taker would always watch regardless of recommendation ( y x , y x ). An always-denier ( y x , y x ) would always not watch regardless of the recommendation. A contrarian ( y x , y x ) would not watch if recommended and would watch otherwise. For users observed with certain characteristics u . (e.g., age, gender, location, watch history), the expected benefit of selecting this group of users for recommendation is given by the following benefit function [18]:
L ( u ) = β Pr ( y x , y x | u ) + γ Pr ( y x , y x | u ) + θ Pr ( y x , y x | u ) + δ Pr ( y x , y x | u )
where Pr ( · | u ) denote the probability that an individual with characteristics u exhibits a given behavior type, and β , θ , γ , δ denote the benefit corresponding to each type. Note that these probabilities are counterfactual since they jointly consider the outcome Y under two conflicting scenarios. The goal is then to optimize L ( u ) over the domain of a fixed set of characteristic variables, U , called unit variables in this example, to find the specific user group that maximizes the benefit. More formally, the setup of this example can be formulated as a Causal Unit Selection problem [18,19]: Given a causal model G over variables X , a causal objective function  L ( U ) mentions a special set of variables U X , called unit variables, and can be any mathematical expression that involves associational, interventional, and counterfactual probabilities induced by model G. An instantiation (assignment) u of unit variables U is called a unit, and the goal is to find the unit u * that optimizes L ( u ) . In contrast with classical objective functions (for example, ones used to train neural networks), it includes quantities from a higher level of the causal hierarchy: interventional or counterfactual, which gives us the ability to distinguish objects depending on their causal behavior.
Causal Unit Selection embeds two subproblems that are generally hard: evaluation which, involves determining the point value of the causal objective function L ( u ) given the available information; and optimization, which involves finding the unit u * that optimizes the score defined by L ( u ) , assuming that the point values of the function are identifiable. Existing work on unit selection has primarily focused on the evaluation problem, under a very practical setting in which only the structure of an SCM is available together with some observational and experimental data [18,19,20,21,22]. In that setting, the data is usually not sufficient to obtain a fully specified SCM, so one cannot obtain point values of the benefit function. Furthermore, these results have largely been dedicated to the specific benefit function in Equation (1). Recent work has therefore focused on bounding the value of the benefit function while tightening these bounds as much as possible [23,24], but with less attention dedicated to optimizing benefits based on these bounds; see [22,25] for a notable exception.
In this paper, we will study unit selection from a different computational perspective and provide an algorithmic treatment of the problem that complements the previous line of work in two key ways. First, we go beyond the benefit function in Equation (1) and treat a broader class of causal objective functions. Second, we focus on the optimization problem. We assume access to a fully specified SCM in which all its parameters are known, and so we can obtain point values for any causal objective function L ( u ) . Under this assumption, the central question then becomes: What kind of algorithms can we design to optimize such objective functions on a causal model? And how hard is it to find the optimal unit exactly, especially when the space of U and the given model is large? Particularly, we make the following contributions:
  • We propose a broader class of causal objective functions that can be expressed as (linear) combination of counterfactual, interventional, or associational probabilities.
  • Given a fully specified SCM, we introduce a reduction from optimizing this class of causal objective functions to the problem of optimizing a single classical associational probability, which we call Reverse-MAP.
  • We establish the computational complexity of the unit selection problem, showing it is N P P P -complete for this class of causal objective functions but is NP-complete when unit variables correspond to all exogenous variables in the given model.
  • We propose the first exact algorithm for finding the optimal unit using Variable Elimination (VE), and characterize its complexity using constrained treewidth.
  • We further propose a more efficient method based on compiling the SCM and causal objective function into a special class of Tractable Arithmetic Circuits (ACs), which allow one to compute optimal units in time linear in the circuit size.
This paper is structured as follows. Section 2 reviews Structural Causal Models and the reduction of counterfactuals into associational probabilities. Section 3 formally defines the treated causal objective functions and the unit selection problem. Section 4 presents the complexity results and the reduction to Reverse-MAP. Section 5 presents the Variable Elimination algorithm for solving unit selection exactly and its runtime complexity. Section 6 presents the more efficient method based on tractable arithmetic circuits. Finally, Section 7 presents the empirical evaluation based on random SCMs, followed by a case study based on a real-world ecological model in Section 8. Section 9 concludes the paper. This paper is a revised and expanded version of [26,27].

2. Background: Structural Causal Models and Counterfactual Queries

We review structural causal models (SCMs) in this section, since the unit selection problem is defined on these models; see [1,10,28,29] for a comprehensive exposition. We use uppercase letters (e.g., X) to denote variables and lowercase letters (e.g., x) to denote their states. We use bold uppercase letters (e.g., X ) to denote sets of variables and bold lowercase letters (e.g., x ) to denote their instantiations (sets of states). The states of a binary variable X are denoted x and x . We also write x x to mean that variable X has state x in instantiation x of variables X .
An SCM has three components. First, a directed acyclic graph (DAG) with its nodes representing variables and edges representing causal dependencies among variables. Root nodes are called exogenous and internal nodes are called endogenous. Second, a probability distribution θ ( U ) for each exogenous variable U in the model. Third, for each endogenous variable V with parents P , the SCM has an equation f V ( P ) , called a structural equation, which specifies a state for V for each instantiation p of its parents P . Let U / V be the exogenous/endogenous variables in an SCM. The joint distribution Pr ( U , V ) specified by the SCM is as follows: Pr ( u , v ) = u u θ ( u ) if V = v is implied by U = u and the structural equations; otherwise, Pr ( u , v ) = 0 .
SCMs are a special type of Bayesian network [14,15], which specifies a conditional probability table (CPT) for each node in the network. In particular, for node V with parents P , the CPT specifies the conditional distributions Pr ( V | P ) . A structural equation can be encoded as a CPT, which contains only deterministic distributions, that is, Pr ( v | p ) { 0 , 1 } for all v and p . Such a CPT is said to be functional, and this is why SCMs are sometimes called functional Bayesian networks.
A Bayesian network (BN) can only be used to compute observational probabilities such as Pr ( y | x ) , which is the probability of Y = y given that we observed  X = x . An SCM can also be used to compute interventional probabilities such as Pr ( y x ) , which is the probability of Y = y after we forcefully set  X = x . The class of causal Bayesian networks sits between BNs and SCMs as it can be used to compute observational and interventional probabilities, but not counterfactual ones [1]. An SCM can further be used to compute counterfactual probabilities such as Pr ( y x , y x | e ) , which is the probability of ( Y = y after setting X = x and Y = y after setting X = x ) in a situation where we observe E = e . We are particularly interested in this form of counterfactual probabilities, as it is very general and will be used as an ingredient in our objective functions. We next show how to compute such a counterfactual probability on an SCM by computing an observational probability on an auxiliary model. This will be essential for the constructions used later in the paper.
Consider the counterfactual probability Pr ( y x , y x | x , y ) on the SCM in Figure 1a. This query has three conflicting components: y x , y x and ( x , y ) . The first two involve conflicting actions (x and x ). Moreover, the actions and outcomes in the first two components conflict with the observation in the third component ( x , y ). This is why computing counterfactual probabilities usually requires an auxiliary model that incorporates multiple worlds (real and imaginary) that all share the same causal mechanisms (exogenous variables). For the counterfactual queries we are interested in, an auxiliary model with three worlds will suffice as we discuss next.
Given an SCM G, its triplet model is another SCM constructed by having three copies G 1 , G 2 and G 3 of G and then joining them so they share their exogenous variables; see Figure 1b. If X is a variable in G 1 , we will use [ X ] to denote its copy in G 2 and [ [ X ] ] to denote its copy in G 3 . A triplet model is a special case of parallel worlds models [30], which also include twin models [9]. Twin models are sufficient to evaluate counterfactual probabilities like Pr ( y x | x , y ) and Pr ( y x , y x ) but not ones like Pr ( y x , y x | e ) , which we are interested in; see also [1,31]. We can now compute the counterfactual probability Pr ( y x , y x | x , y ) on SCM G by operating on the triplet model as follows. First, we mutilate copies G 2 and G 3 in the triplet model by removing the edges pointing into variables [ X ] and [ [ X ] ] and setting [ X ] = x and [ [ X ] ] = x (since we are intervening on these variables). The result is a mutilated triplet model shown in Figure 1c. We can then evaluate Pr ( y x , y x | x , y ) on the SCM G by computing the observational probability Pr ( [ y ] , [ [ y ] ] [ x ] , [ [ x ] ] , x , y ) on the mutilated triplet model. Intuitively, the triplet model can be viewed as capturing three worlds G 1 , G 2 and G 3 . World G 1 captures the observation x , y ; world G 2 captures the intervention X = x , and world G 3 captures the intervention X = x . The above treatment can be directly generalized to counterfactual queries of the form Pr ( y x , w v | e ) , where E , X , Y , V , W are sets of variables. It is precisely this class of counterfactual queries that we shall use in the rest of the paper, starting with the next section.

3. Causal Objective Functions and Unit Selection

A causal objective function can be any expression that involves observational, interventional or counterfactual probabilities, where the goal of the unit selection is to find objects (units) that optimize this function. However, inspired by [18], our treatment will be based on a specific class of causal objective functions, which is a linear combination of counterfactual probabilities of the form Pr ( y i x i , w i v i | e i , u ) , where i = 1 , , n . We call U the unit variables since our goal is to find instantiations u of these variables (i.e., units) that optimize the objective function. We note that the term “unit” is used differently in some literature, where it refers to the unit of analysis; in this paper, a unit always refers to an instantiation of variables U . Variables X i V i represent treatments, variables Y i W i represent outcomes, ( X i V i ) ( Y i W i ) = , and variables E i represent evidence. Unit variables are shared by all components of the objective function, but each component can have its own treatment, outcome, and evidence variables.
We will assume that treatment, outcome, and evidence variables are endogenous variables (roots) and unit variables cannot be descendants of treatment or outcome variables. This is consistent with the assumption in [18,19] on unit variables (also called characteristics). This leads us to the objective functions of the following form (the conditions we place on weights w i are assumed for convenience and are not restrictive for our treatment):
L ( u ) = i = 1 n w i · Pr ( y x i i , w v i i | e i , u ) where w i 0
We can now formally define the unit selection inference problem on SCMs.
Definition 1
(Unit Selection). Given an SCM G, a subset  U  of its variables, and an objective function  L ( u ) , such as Equation (2), the unit selection inference problem is to compute  argmax u L ( u ) .
The benefit function discussed in [18] has the following form:
L ( u ) = β Pr ( y x , y x | u ) + γ Pr ( y x , y x | u ) + θ Pr ( y x , y x | u ) + δ Pr ( y x , y x | u )
This class of objective functions falls as a special case of Equation (2) by setting n = 4 , E i = , X i = V i = { X } and Y i = W i = { Y } for i = 1 , , 4 , where X , Y are binary variables. That is, each component i of the objective function uses the same single, treatment variable X and the same single, outcome variable Y. A more general form was proposed in [20] in which treatment X has values x 1 , , x m and outcome Y has values y 1 , , y k so the objective function can have up to k m components, each corresponding to a distinct response type such as Pr ( y 2 x 1 , y 1 x 2 , y 1 x 3 , y 3 x 4 , y 2 x 5 | u ) when k = 3 and m = 5 . This class of objective functions is more general than Equation (2), as it allows one to express more response types, but it assumes one treatment variable and one outcome variable. The class of objective functions we consider in Equation (2) allows compound treatments and outcomes. It also allows us to seek units from a particular group. For example, if A and B are two medications (binary treatments) and T and P refer to high temperature and high blood pressure (binary outcomes), and E is the age group with values e 1 , , e 4 , then the objective function can include terms such as Pr ( ( t , p ) a , b , ( t , p ) a , b e 3 , u ) , which is the probability that a member of the third age group would have a high temperature and normal blood pressure if administered both medications and would have normal temperature and blood pressure if administered only the second medication. Moreover, since the objective function components can have different treatment and outcome variables, one can select units based on their responses to distinct stimuli (e.g., the effect of one type of encouragement for membership renewal and the simultaneous effect of another type of encouragement on increased purchases). Going beyond the form in Equation (2), one can use causal objective functions with more general ingredients, such as the probability of a patient being a responder, given that they are not a contrarian, Pr ( y x , y x | ¬ ( y x , y x ) ) ; or the probability that a patient would not have had a stroke if they were on a diet ( y d ) or had exercised ( y e ) given that they did neither ( d , e ) , i.e., Pr ( y d y e | y , d , e ) . Such general quantities have not been treated in the literature, but some discussions have argued for their significance and treated some special cases; e.g., [32].

4. Complexity of Unit Selection and Reduction to Reverse-MAP

We show next that unit selection is NP PP -complete for the class of causal objective functions given in Equation (2). We also show that this problem is NP-complete when unit variables correspond to all exogenous variables in the SCM. For background on complexity classes that are relevant to Bayesian network inference, see [33] on the MPE decision problem being NP-complete, and [34] on the MAP decision problem being NP PP -complete. Ref. [35] shows that computing node marginals in a Bayesian network is # P -complete. For a textbook discussion of these complexity results, see [15] (Ch. 11).
We start by providing an efficient reduction from unit selection into a variant of the well-known MAP inference problem, which we call Reverse-MAP. We then follow by studying the complexity of Reverse-MAP and the unit selection.
Recall that our goal is to find units u that maximize the value L ( u ) of the objective function. The first step in solving this optimization problem is to be able to evaluate the objective L ( u ) . We next show a construction that allows us to evaluate L ( u ) by evaluating a single observational probability involving unit variables U but on an extended and mutilated model. This construction will serve two purposes. First, it will permit us to characterize the complexity of the unit selection when using objective functions in the form of Equation (2). Second, we will later use the construction to develop a specific algorithm for solving the unit selection problem using these objective functions.
Consider each term Pr ( y x i i , w v i i | e i , u ) in Equation (2). We reviewed in Section 2 how this quantity can be reduced to a classical conditional probability on a triplet model G i . The next step is to encode a linear combination of these conditional probabilities as a conditional probability on some model G . This is performed using the following construction.
Definition 2
(Objective Model). Consider an SCM G with parameters θ and the objective function L in Equation (2). The objective model  G  for  G , L  is constructed as follows with parameters  θ :
1. 
Construct a triplet model G i of G for each term Pr ( y x i i , w v i i | e i , u ) in L (see Section 2). Join G 1 , , G n so that their unit variables U are shared. If a variable U U is a root, then G 1 , , G n shares a single node U; if a variable U U is internal, then each triplet model G i has created three copies U i , [ U i ] , and [ [ U i ] ] . We enforce an equality constraint among the real-world copies U i across G 1 , , G n by adding an auxiliary node as a common child of these copies (for a discussion of this auxiliary-node method, see [15] (Ch. 5.2)). This leads to model G .
2. 
Add a node H to G as a parent of all outcome nodes Z = { [ Y i ] , [ [ W i ] ] } i = 1 n . Node H has states h 1 , , h n and prior θ ( h i ) = w i . Each node Z Z now has parents P Z { H } , where P Z are the parents of Z in G before node H is added. Let z i be the state of Z in the corresponding instantiation y i w i of the objective function L. The new CPT for Z is as follows:
P Z HZ θ ( Z | P Z , H )
p h i z i θ ( z i | p )
p h i z ¯ i θ ( z ¯ i | p )
p h ¯ i z i 1.0
p h ¯ i z ¯ i 0.0
Here, z ¯ i , h ¯ i denote any states of variables Z , H that are distinct from states z i , h i .
We say the objective model G has n components, and call H the mixture variable as it encodes a mixture of the objective function terms. The CPTs for variables [ Y i ] , [ [ W i ] ] in model G reduce to their original CPTs in SCM G when H = h i , and imply [ Y i ] = y i , [ [ W i ] ] = w i when H h i . The objective L ( u ) in SCM G is a classical probability in the objective model G (proof in Appendix A).
Theorem 1.
Consider an SCM G with unit variables U . Let L be the objective function in Equation (2), and let G be an objective model for G , L . Let X = { [ X i ] } i = 1 n , Y = { [ Y i ] } i = 1 n , W = { [ [ W i ] ] } i = 1 n , V = { [ [ V i ] ] } i = 1 n and E = { E i } i = 1 n . We have L ( u ) = Pr ( y , w | x , v , e , u ) , where y , w , x , v , e are the instantiations of variables Y , W , X , V , E in objective function L.
Consider the SCM in Figure 1a and the causal objective function L ( u ) = w 1 · Pr ( y x , y x | u ) + w 2 · Pr ( y x , y x | u ) . Figure 2 shows a corresponding objective model G constructed according to Definition 2. We now have L ( u ) = Pr ( [ y 1 ] , [ [ y 1 ] ] , [ y 2 ] , [ [ y 2 ] ] [ x 1 ] , [ [ x 1 ] ] , [ x 2 ] , [ [ x 2 ] ] , u ) .
Theorem 1 suggests that we can optimize the objective function L ( u ) on an SCM G by computing the instantiation argmax u Pr ( y , w | x , v , e , u ) on an objective model G . This is similar to the classical MAP problem on model G , except that the optimized variables U appear after the conditioning operator instead of before it. This leads to our definition of the Reverse-MAP problem.
Definition 3
(Reverse-MAP). Consider an SCM G with distribution  Pr  and suppose  U , E 1 , E 2  are disjoint sets of variables in G. The Reverse-MAP instantiation for variables  U  and instantiations  e 1 , e 2  is defined as follows:  RMAP ( U , e 1 , e 2 ) argmax u Pr ( e 1 u , e 2 ) .
To see the connection between Reverse-MAP and MAP, note that argmax u Pr ( e 1 | u , e 2 ) = argmax u Pr ( u , e 1 , e 2 ) / Pr ( u , e 2 ) , where argmax u Pr ( u , e 1 , e 2 ) = argmax u Pr ( u | e 1 , e 2 ) is the known MAP problem [14]. In general, the MAP instantiation argmax u Pr ( u , e 1 , e 2 ) is not the Reverse-MAP instantiation since Pr ( u , e 2 ) also depends on U ; see Appendix B for a concrete example that illustrates this point. We now have the following result, proven in Appendix C.
Corollary 1.
There are polynomial-time reductions between the Reverse-MAP problem and the unit selection problem with objective functions in the form of Equation (2).
We next characterize the complexity of Reverse-MAP under different conditions. Consider a decision version of the problem, D-Reverse-MAP, defined as follows.
Definition 4
(D-Reverse-MAP). Given an SCM with rational parameters that induces distribution  Pr , some target variables  U , some evidence  e 1 , e 2  and a rational threshold p, the D-Reverse-MAP problems ask whether there is an instantiation  u  of  U  such that  Pr ( e 1 | u , e 2 ) > p .
The next theorem shows that D-Reverse-MAP is NP PP -complete, like classical MAP [34]. Its proof can be found in Appendix D.
Theorem 2.
D-Reverse-MAP is NP PP -complete.
We can now characterize the complexity of unit selection inference problem using Theorem 2 and Corollary 1.
Corollary 2.
Unit selection is NP PP -complete assuming the objective function in Equation (2).
In an SCM, exogenous (root) variables represent all uncertainties in the model, and the endogenous (internal) variables are uniquely determined by exogenous variables. This property of SCMs significantly reduces the complexity of unit selection when the unit variables correspond to all SCM exogenous variables. This is implied by the following result, which is proven in Appendix E.
Theorem 3.
D-Reverse-MAP is NP-complete if its target variables are all the SCM root variables.
Corollary 3.
Unit selection is NP-complete when the unit variables are all the SCM exogenous (root) variables, assuming the objective functions in Equation (2).

5. Solving Unit Selection Using Variable Elimination

Section 4 provided a reduction from unit selection on an SCM to Reverse-MAP on an objective model. In Section 5.1, we provide a Variable Elimination (VE) algorithm for Reverse-MAP, which can be applied to the objective model to solve unit selection. In Section 5.2, we analyze the complexity of this method and compare it to the complexity of Reverse-MAP on the underlying SCM.

5.1. Reverse-MAP Using Variable Elimination

Our VE algorithm for Reverse-MAP will employ the same machinery and techniques used in the VE algorithm for classical MAP [36]. Hence, we will first review the VE algorithm for MAP using the treatment in [15] (Ch 10) and then discuss the algorithm for Reverse-MAP.
The VE algorithm is based on the notion of a factor  f ( X ) , which maps each instantiation x of variables X into a non-negative number f ( x ) . VE employs a number of factor operations, including multiplying two factors ( f · g ), summing out a variable from a factor ( X f ), maximizing out a variable from a factor ( max X f ), and dividing two factors ( f / g ). Let G be an SCM and assume its variables Z are partitioned into three disjoint sets U , V , E , where U are the target variables and E are the evidence variables. Let S = Z U in the following discussion. We will treat the CPT of each variable Z in SCM G as a factor over Z and its parents P , denoted f Z ( Z P ) . The SCM distribution is then Pr ( Z ) = Z Z f Z . We capture evidence e by creating an evidence factor λ e ( E ) for each e e with λ e ( e ) = 1 if e = e and λ e ( e ) = 0 otherwise. The MAP probability is given by Equation (4). The left-hand side is a scalar (probability), while the right side is a factor over an empty set of variables, which is called a scalar factor. Such a factor maps only one instantiation, the empty one, to a scalar.
MAP p ( U , e ) = max u Pr ( u , e ) = max u v Pr ( u , v , e ) = max U S Z Z f Z e e λ e ( E )
This is in contrast to the MAP instantiation, which is argmax u Pr ( u , e ) . With some minor bookkeeping, the VE algorithm for computing the MAP probability can also return a MAP instantiation; see, e.g., [15] (Ch 10). Hence, we will focus next on computing the MAP probability. Consider the SCM in Figure 3 and suppose U = { A , B } and the evidence e is { E = e } . In this case, MAP p ( A B , e ) will be equal to
max A B C D E f A ( A ) f B ( A B ) f C ( A C ) f D ( B C D ) f E ( C E ) λ e ( E )
A naive evaluation of this expression multiplies all factors to yield a factor f ( A B C D E ) over all variables, then computes max A B C D E f ( A B C D E ) , leading to O ( n exp ( n ) ) complexity, where n is the number of model variables. The VE algorithm tries to compute this expression more efficiently with pseudocode provided in Algorithm 1 (MAP_VE). The product of factors F on Line 4 represents the joint distribution Pr ( Z , e ) so we first sum out variables S from F on Line 5 to compute a set of factors G whose product represents the marginal Pr ( U , e ) . We then maximize our variables U from G on Line 6, leading to a scalar factor p that contains the MAP probability. The left side of Equation (4) is a scalar (probability) while the result of the right side is a factor over an empty set of variables, which is called a scalar factor. Such a factor maps only one instantiation, the empty one, to a scalar. Algorithm 1 eliminates variables one by one using Algorithm 2 and a total variable order π = π S , π U , known as an elimination order. MAP_VE requires variables U to appear last in order π since summation does not commute with maximization. An order that satisfies this constraint is known as a U -constrained elimination order. The complexity of MAP_VE depends on the used elimination order π . In each elimination step of Algorithm 2, we multiply all factors that mention variable π ( i ) to obtain factor f i on Line 6. The variables in f i are called a cluster C i ; thus, eliminating variables π ( 1 ) , , π ( n ) induces clusters C 1 , , C n . The width w of elimination order π is the size of the largest cluster minus one, and the complexity of MAP_VE is O ( n exp ( w ) ) .
Algorithm 1 MAP_VE ( G , U , e )
input: SCM G, target variables U , evidence e
output: scalar factor containing MAP p ( U , e )
1:procedure main
2:       π S an elimination order for non-target variables
3:       π U an elimination order for target variables U
4:       F { f : f is a CPT of SCM G } { λ e : λ e is an evidence factor for e e }
5:       G eliminate( , F , π S )
6:       p eliminate( max , G , π U )
7:      return p
8:end procedure
Algorithm 2 Eliminating Variables using Sum or Max
input: an operation { , max } , a set of factors F , a total variable order π
output: a set of factors
1:procedure eliminate( , F , π )
2:      for  i = 1 to length of order π  do
3:             V i t h variable in order π
4:             G factors in F that mention variable V
5:             f i f G f
6:             f i V f i
7:            replace factors G in F with factor f i
8:      end for
9:      return  F
10:end procedure
The table below depicts the trace of MAP_VE when computing the MAP probability in Equation (5) using the elimination order π = E , D , C , B , A . The trace shows that MAP_VE evaluates the following the factorized expression and that the width of order π is 2 (largest cluster has size 3):
MAP p ( A B , e ) = max A f A ( A ) max B f B ( A B ) C f C ( A C ) D f D ( B C D ) E f E ( C E ) λ E
ieliminated varfactors G (Line 4, Algorithm 2)new factor f i (Line 6, Algorithm 2) C i
1E f E ( C E ) λ E f 1 = E f E ( C E ) λ E CE
2D f D ( B C D ) f 2 = D f D ( B C D ) BCD
3C f C ( A C ) f 1 ( C ) f 2 ( B C ) f 3 = C f C ( A C ) f 1 ( C ) f 2 ( B C ) ABC
4B f B ( A B ) f 3 ( A B ) f 4 = max B f B ( A B ) f 3 ( A B ) AB
5A f A ( A ) f 4 ( A ) p = max A f A ( A ) f 4 ( A ) A
Choosing a significant elimination order is critical for the complexity of VE. The treewidth of an SCM G is defined as the minimum width attained by any elimination order. Since MAP requires U -constrained orders, the U -constrained treewidth of G is defined as the minimum width attained by any U -constrained elimination order [34].
We are now ready to introduce our VE algorithm for Reverse-MAP. Again, we assume that the model variables Z are partitioned into disjoint sets U , V , E , where U are the target variables and S = Z U . But we further partition the evidence variables E into E 1 and E 2 . Again, we focus on computing the Reverse-MAP probability RMAP p ( U , e 1 , e 2 ) instead of the instantiation:
max u Pr ( e 1 | u , e 2 ) = max u Pr ( u , e 1 , e 2 ) Pr ( u , e 2 ) = max u v Pr ( u , v , e 1 , e 2 ) v Pr ( u , v , e 2 ) = max U S Z Z f Z e e 1 e 2 λ e S Z Z f Z e e 2 λ e
Our algorithm, called RMAP_VE, runs two passes of elimination, as shown in Algorithm 3. In the first pass (Line 4), we sum out variables S under evidence e 1 , e 2 and in the second pass (Line 5), we sum out variables S under evidence e 2 . This leads to two sets of factors G 1 and G 2 , which correspond to marginal distributions Pr ( U , e 1 , e 2 ) and Pr ( U , e 2 ) . Now we need to divide Pr ( U , e 1 , e 2 ) and Pr ( U , e 2 ) to compute Pr ( e 1 | U , e 2 ) . We next show that this can be performed efficiently by “dividing” G 1 and G 2 , as shown on Line 8. The key idea is that if we run the two passes of elimination according to the same elimination order, then there will be a one-to-one correspondence between the factors in G 1 and G 2 . Let ( g 1 i , g 2 i ) be the corresponding pairs of factors for i = 1 , , k , where k = | G 1 | = | G 2 | . What we need is i = 1 n g 1 i / i = 1 n g 2 i since this represents Pr ( e 1 | U , e 2 ) . But due to the mentioned correspondence, this equals i = 1 n g 1 i / g 2 i . Thus, we can divide each pair of corresponding factors to obtain the set of factors G as performed on Line  8. We finally maximize our target variables U from G to obtain the Reverse-MAP probability (Line 9).
Algorithm 3 RMAP_VE( G , U , e 1 , e 2 )
input: SCM G, target variables U , evidence e 1 and e 2
output: scalar factor containing RMAP p ( U , e 1 , e 2 )
1:procedure main
2:       π S an elimination order for non-target variables
3:       π U an elimination order for target variables U
4:       F 1 { f : f is a CPT of SCM G } { λ e : λ e is an evidence factor for e e 1 , e 2 }
5:       F 2 { f : f is a CPT of SCM G } { λ e : λ e is an evidence factor for e e 2 }
6:       G 1 eliminate( , F 1 , π S )
7:       G 2 eliminate( , F 2 , π S )
8:       G { g 1 / g 2 : g 1 , g 2 are corresponding factors in G 1 , G 2 }
9:       p eliminate( max , G , π U )
10:      return p
11:end procedure
RMAP_VE has the same complexity as MAP_VE if both use the same elimination order. Suppose there are k factors in G 1 / G 2 / G and the largest factor has size c. The cost of division on Line 8 is O ( k exp ( c ) ) , while the cost of maximization on Line 9 is at least O ( k exp ( c ) ) ; thus, the cost of division is dominated by the cost of maximization. Hence, the complexity of RMAP_VE is still O ( n exp ( w ) ) , where n is the number of variables and w is the width of the used U -constrained order π .

5.2. Bounding the Complexity of Unit Selection Using Variable Elimination

We can solve unit selection by applying RMAP_VE to an objective model of the SCM, as shown by Theorem 1. However, RMAP_VE (and MAP_VE) is expected to be more expensive on the objective model compared to the given SCM since the former is larger and denser than the latter. But how much more expensive? In particular, is RMAP_VE always tractable on the objective model when it is tractable on the underlying SCM? We consider this question next using the lens of treewidth, which is commonly used to analyze elimination algorithms. Recall also that MAP_VE and RMAP_VE have the same complexity when applied to the same SCM using the same target variables.
Our starting point is to study the treewidth of an objective model in relation to the treewidth of its underlying SCM. We will base our study on the techniques and results reported in [37], which studied the complexity of counterfactual reasoning. In particular, given an elimination order π of SCM G, we next show how to construct an elimination order π for the objective model G while providing a bound on the width of order π in terms of the width of order π . Recall that we use [ X ] and [ [ X ] ] to denote the copies of the variable X in a triplet model, where X = [ X ] = [ [ X ] ] if X is exogenous. Moreover, if U is a unit variable, then U = U 1 = = U n in an objective model.
Definition 5.
Let G be an SCM and  G  be a corresponding objective model with n components. If π is an elimination order for G, the corresponding elimination order  π  for  G  is obtained by replacing each non-unit variable X in π by  X 1 , , X n , [ X 1 ] , , [ X n ] , [ [ X 1 ] ] , , [ [ X n ] ]  then appending the mixture variable H to the end of the order.
Consider the elimination order π = A , X , Y , U for the SCM in Figure 1a. The corresponding elimination order π for the objective model in Figure 2 is as follows:
π = A 1 , A 2 , X 1 , X 2 , [ X 1 ] , [ X 2 ] , [ [ X 1 ] ] , [ [ X 2 ] ] , Y 1 , Y 2 , [ Y 1 ] , [ Y 2 ] , [ [ Y 1 ] ] , [ [ Y 2 ] ] , U , H
The following bound (Theorem 5) follows from Lemma 1 and Theorem 4, which concerns n-world models. Given an SCM G and a subset U of its roots, an n-world model is obtained by creating n copies of G that share nodes U  [37]. This notion corresponds to parallel worlds models [30] when U contains all roots of SCM G. An objective model with n components can be viewed as a 3 n -world model, but with an additional mixture node H and some edges that originate from H. Lemma 1 and Theorem 5 are proven in Appendix G and Appendix H.
Lemma 1.
Consider an SCM G and suppose SCM G is obtained from G by adding a root node H as a parent of some nodes in G. If π is an elimination order for G and has width w, then π = π , H is an elimination order for G and has width w w + 1 .
Theorem 4
([37]). Consider an SCM G, a subset U of its roots and a corresponding n-world model G . If G has an elimination order π with width w, then there exists a corresponding elimination order π of G that has width w n ( w + 1 ) 1 .
Theorem 5.
Consider an SCM G and a corresponding objective model G with n components. Let π be an elimination order for G and let π be the corresponding elimination order for G . If π has width w and π has width w , then w 3 n ( w + 1 ) .
Corollary 4.
If w is the treewidth of an SCM G and w is the treewidth of a corresponding objective model G with n components, then w 3 n ( w + 1 ) .
As mentioned earlier, RMAP_VE and MAP_VE require a U -constrained elimination orders in which unit variables U appear last in the order. Hence, a U -constrained elimination order for an objective model must place the mixture variable H before U . This leads to the next definition.
Definition 6.
Let G be an SCM with unit variables  U  and let  G  be a corresponding objective model with n components. If π is a  U -constrained elimination order for G, the corresponding  U -constrained elimination order  π  for  G  is obtained by replacing each non-unit variable X in π by  X 1 , , X n , [ X 1 ] , , [ X n ] , [ [ X 1 ] ] , , [ [ X n ] ]  then inserting mixture variable H just before  U .
Consider the U -constrained order π = A , X , Y , U for the SCM in Figure 1a. The corresponding U -constrained elimination order for the objective model in Figure 2 is
π = A 1 , A 2 , X 1 , X 2 , [ X 1 ] , [ X 2 ] , [ [ X 1 ] ] , [ [ X 2 ] ] , Y 1 , Y 2 , [ Y 1 ] , [ Y 2 ] , [ [ Y 1 ] ] , [ [ Y 2 ] ] , H , U
We now have the following bound on the U -constrained treewidth of objective models, which is somewhat unexpected when compared to the bound on treewidth. In particular, while the bound on treewidth grows linearly in the number of components in the objective model, the bound on U -constrained treewidth is independent of such a number. Moreover, the bound on U -constrained treewidth can depend on the number of unit variables, which is not the case for treewidth.
Theorem 6.
Let G be an SCM with unit variables U and let G be a corresponding objective model. If π is a U -constrained elimination order for G with width w and π is the corresponding U -constrained elimination order for G with width w , then w max ( 3 w + 3 , | U | ) . If the objective function in Equation (2) has one outcome variable ( Y i = W i = { Y } for all i), then w 3 w + 3 .
Corollary 5.
Let G be an SCM with unit variables U and let G be a corresponding objective model. If w and w are the U -constrained treewidths of G and G , then w max ( 3 w + 3 , | U | ) . Moreover, if the objective function in Equation (2) has a single outcome variable, then w 3 w + 3 .
The above bounds can be significantly tighter depending on the objective function properties. Corollary 5 identifies one such property, which is satisfied by the benefit function in [18]; see Equation (3). Moreover, the factor 3 in these bounds is an implication of using a triplet model, which may not be necessary. Consider components Pr ( y x i i , w v i i | e i , u ) in the objective function of Equation (2). If E i = for all i, then a twin model is sufficient when building an objective model (similarly if Y i = X i = or W i = V i = ). The objective function in Equation (3), from [18], has E i = for all i so it leads to the tighter bound w 2 w + 2 . More generally, if the objective function properties lead to removing the dependence on | U | in the bound of Corollary 5, then RMAP_VE on an objective model is tractable if RMAP_VE (MAP_VE) is tractable on the underlying SCM. Otherwise, the bound in Corollary 5 does not guarantee this. Recall that MAP, Reverse-MAP, and unit selection using Equation (2) are all NP PP -complete, as shown earlier.
We note that the complexity bounds provided for MAP_VE and RMAP_VE are expressed in terms of treewidth. However, tighter bounds can be obtained using the notion of causal treewidth [38,39], which is no greater than treewidth and can remain bounded even when treewidth is not, by leveraging functional dependencies in SCMs [38]. This is a subject for future work.

6. Accelerating Unit Selection Using Tractable Arithmetic Circuits

We presented earlier an exact algorithm for solving unit selection based on Variable Elimination. The algorithm and its complexity are structure-based, meaning that they depend only on the structure of the causal model, and not on the specific values of its parameters (i.e., CPTs or structural equations). However, it is known that the performance of probabilistic inference algorithms can be improved significantly by exploiting the specific values or properties of the model parameters, such as 0/1 parameters, context-specific independence, functional dependencies, and parameter equality; see, e.g.,  [38,39,40,41]. These are known as local/parametric structures and are common in SCMs. We pursue an approach for exploiting local structures in this section, which compiles the objective model into a tractable Arithmetic Circuit (AC) to accelerate the search for optimal units. We first provide some background on ACs in Section 6.1. We next discuss in Section 6.2 how a special class of ACs can be used to solve MAP exactly in time linear in the AC size. We finally propose a new algorithm in Section 6.3 for solving R-MAP exactly on ACs, which can then be applied to the compiled AC from the objective model to solve unit selection.

6.1. Background on AC

An arithmetic circuit (AC) is based on a set of discrete variables, which define a key ingredient of the circuit: the indicators. For each value x of a variable X, we have an indicator λ x . The AC will then have constants and indicators as its leaf nodes (inputs) with adders and multipliers as its internal nodes; see Figure 4. An AC represents a factor, which is a mapping from variable instantiations to non-negative numbers; see Figure 4. A probability distribution is a special case of a factor, so an AC can represent a distribution too, which is our focus in this work. The factor represented by an AC is obtained by evaluating the AC at complete variable instantiations. To evaluate the AC at an instantiation e , we replace each indicator λ x with 1 if the value x is compatible with instantiation e and with 0 otherwise [42]. We then evaluate the AC bottom-up in the standard way. The factor f ( A , B ) in Figure 4 has four rows, which correspond to the four instantiations of variables A and B. Evaluating the AC in this figure at each of these complete instantiations yields a value for each instantiation and therefore defines its factor. We say in this case that the AC computes this factor. An AC can be evaluated at a partial variable instantiation using the same procedure, but the value returned may not be meaningful unless the circuit satisfies certain properties. Three key such properties are decomposability, determinism, and smoothness [42]. Decomposability requires that no two indicators for the same variable may appear under two distinct children of the same ∗-node. Smoothness requires that every pair of children for a +-node mention the same set of variables (in indicators). Determinism requires at most one non-zero child for each +-node, when the circuit is evaluated under any complete variable instantiation. An AC that represents a probability distribution Pr ( X ) will return the marginal Pr ( e ) when evaluated at input e , assuming the AC is deterministic, decomposable and smooth [42]. It will also compute the MPE probability under evidence e in this case, assuming we replace +-nodes with max-nodes [43]. In fact, determinism is not needed for computing marginals, as shown initially in [44], and discussed in detail in [45]. See also [46] for a recent tutorial/survey on ACs and their properties.

6.2. MAP Using AC

We next discuss a special class of arithmetic circuits, decision-ACs, which can be used to solve MAP in time linear in the AC size, assuming the AC is constructed subject to specific constraints [47,48]. These constraints ensure a general condition (determinism after projection), as identified and discussed in [45], which allows MAP to be solved in linear time. We review these findings next and formalize some of the associated observations as we need them to provide a basis for our treatment of R-MAP.
Definition 7
(Decision-AC). Let  AC ( X )  be a decomposable and smooth arithmetic circuit over variables  X .  AC  satisfies the decision property if every +-node has the form  n = i λ x i n i , where  x i  are distinct values of some variable  X X  and  n i  are circuit nodes. We say X is the decision variable of node n, denoted  dvar ( n ) .
The decision property implies determinism, so decision-ACs are decomposable, smooth, and deterministic. Decision-ACs are the numerical analog of the Boolean decision-DNNFs [49] and have been used extensively in probabilistic reasoning [42,47,48,50]. For example, the state-of-the-art ACE system [40] encodes a Bayesian Network using a CNF, compiles the CNF into a decision-DNNF using the C2D [51] compiler, and finally converts the decision-DNNF into a decision-AC. Compilation based on Variable Elimination also produces decision-ACs [15].
Proposition 1.
Consider a decision-AC over variables X and let U X . If the circuit satisfies the following: (1) no +-node n with dvar ( n ) U is below some +-node m with dvar ( m ) U and (2) every indicator λ x is attached to some +-node n with dvar ( n ) = X , then this circuit supports linear-time MAP over variables U .
If a decision-AC satisfies Conditions (1) and (2) of Proposition 1, then we can compute MAP p ( U , e ) exactly by traversing the AC bottom-up, while replacing every +-node n with a max-node if dvar ( n ) U . This was first claimed in [47] without a formal proof and was used in later works, e.g., [48,52], to solve related problems. Condition (1) was identified in [47]. Condition (2), while ensured by the ACE system [40] in practice, was never made explicit in the literature, as far as we know, and is needed for the proof of Proposition 1. Our proof of this proposition is embedded in the upcoming discussion and considers a more general condition identified in [45] which allows linear-time MAP on ACs and is satisfied by decision-ACs, as we also prove.
Let U be the MAP variables and V be all other variables. The MAP problem can be solved by first computing the marginal Pr ( U , e ) = V Pr ( X , e ) , which sums-out variables V (projects on variables U ), and then computing the MPE max U Pr ( U , e ) ; see, e.g., [15]. A decomposable and smooth AC supports linear-time marginal as we can simply set all indicators of variables V to 1. If the AC is also deterministic, then it also supports linear-time MPE. However, after projecting a deterministic, decomposable, and smooth AC on variables U , the resulting AC over variables U may no longer be deterministic. If an AC remains deterministic after being projected on U , we can easily compute MAP by evaluating the circuit bottom-up while replacing every +-node that depends on variables in U with a max-node. This was first shown in [45] and the determinism-after-projection property was later referred to as marginal determinism in [53].
Definition 8.
Consider a decomposable and smooth AC over variables  X  and let  U X . The AC is U-deterministic iff the following holds: for any +-node n, if n depends on  U  (i.e.,  vars ( n ) U ), then at most one child of n can be non-zero when the AC is evaluated at any input  u  (recall that evaluating an AC at input  u  is performed by replacing every indicator  λ x  with 0 if x is incompatible with  u  and with 1 otherwise).
If an AC is U -deterministic, then it can be used to compute the MAP probability MAP p ( U , e ) under any evidence e by performing a bottom-up traversal, as in Equation (6):
val ( n ) = 0 , if n is an indicator λ x and x conflicts with e 1 , if n is an indicator λ x and x does not conflict with e p , if n is a parameter p c ch ( n ) val ( c ) , if n is a product node max c ch ( n ) val ( c ) , if n is a sum node and vars ( n ) U c ch ( n ) val ( c ) , if n is a sum node and vars ( n ) U =
The correctness of this procedure is established as follows. Given decomposability and smoothness, by fixing the indicators of variables V to 1, we obtain another decomposable and smooth AC that computes the projection Pr ( U ) = V Pr ( U , V ) . We can then reduce nodes that do not depend on U to constants (parameters). This leads to a projected AC that depends only on U , AC p ( U ) . If AC ( X ) is U -deterministic, then AC p ( U ) must be deterministic, so it can compute the MPE probability max U Pr ( U ) in linear time after replacing its +-nodes with max-nodes. We finally show that decision-ACs (Definition 7) are indeed U -deterministic, which immediately implies Proposition 1, therefore showing that decision-ACs support linear-time MAP.
Proposition 2.
A decision-AC is U -deterministic if it satisfies the two conditions of Proposition 1.
The proof of this proposition can be found in Appendix J.

6.3. Reverse-MAP Using AC

We now consider the main question behind our proposed method for unit selection: under what conditions, and why, will an AC attain the ability to support efficient R-MAP? The answer is motivated by the following observation.
The primitive operation required by R-MAP, beyond the existing ones for classical MAP, is the ability to divide two distributions that have the same domain. That is, to obtain Pr ( e 1 | U , e 2 ) , we need to divide Pr ( U , e 1 e 2 ) and Pr ( U , e 2 ) , which is generally hard. Hence, we raise the following question: given two distributions— Pr 1 ( X ) and Pr 2 ( X ) —computed using ACs, can we efficiently obtain an AC that computes their quotient Pr 3 ( X ) = Pr 1 ( X ) / Pr 2 ( X ) ? We show that this is feasible if Pr 1 ( X ) and Pr 2 ( X ) are computed by two ACs with the same structure (but with different parametrizations), assuming the ACs are deterministic, decomposable, and smooth.
Theorem 7.
Consider an AC that is deterministic, decomposable, and smooth under both parametrization Θ 1 and Θ 2 . Suppose further the AC computes the distribution Pr 1 ( X ) under Θ 1 and the distribution Pr 2 ( X ) under Θ 2 . Then the AC is deterministic, decomposable, and smooth and computes Pr 3 ( X ) = Pr 1 ( X ) / Pr 2 ( X ) under parametrization Θ 3 = { θ 1 / θ 2 : θ 1 , θ 2 are corresponding parameters in Θ 1 , Θ 2 } . We assume Pr 2 has larger support than Pr 1 , i.e., Pr 2 ( x ) = 0 only if Pr 1 ( x ) = 0 . We define 0 / 0 = 0 ).
Hence, we can divide two distributions Pr 1 and Pr 2 —induced by ACs with the same structure—by simply dividing the corresponding parameters in the ACs that lead to Pr 1 and Pr 2 . Decomposability and smoothness are not enough, we also need determinism. The proof of Theorem 7 (in Appendix K) is based on the notion of a complete subcircuit, which was introduced in [43] and studied extensively in [45].
We are now ready to introduce our second, circuit-based method for solving R-MAP. Again, let U be target variables and E 1 , E 2 be evidence variables. Let V = X U be non-target variables. Given a U -deterministic AC ( X ) that represents distribution Pr ( X ) , our algorithm, called RMAP_AC, computes the R-MAP probability Pr ( e 1 | U , e 2 ) by running a two-pass traversal on the circuit, as shown in Algorithm 4, analogous to how Variable Elimination is extended to R-MAP.
Algorithm 4 RMAP_AC( AC , U , e 1 , e 2 )
input:
   AC :     U -deterministic arithmetic circuit
   U :      target variables
   e 1 :      evidence before the conditioning operator
   e 2 :      evidence after the conditioning operator
output: returns the R-MAP probability value max u Pr ( e 1 u , e 2 )
1:procedure main
2:      for each node n in AC (children before parent) do
                      Case I: Leaf node
3:              if n is an indicator node λ x of variable X then
4:                    if  X U thenn is indicator of non-target variables
5:                   n . val 1 , n . val 2 1 [ x e 1 e 2 ] , 1 [ x e 2 ]
6:                    elsen is indicator of target variables
7:                   n . val 1
8:                    end if
9:            else if n is a parameter node p then
10:                     n . val 1 , n . val 2 p , p
            Case II: Internal node independent of U
11:            else if  vars ( n ) U =  then
12:                    if n is a sum node thenn stores two sums with respect to different evidence
13:                   n . val 1 c ch ( n ) c . val 1
14:                   n . val 2 c ch ( n ) c . val 2
15:                    else if n is a product node thenn stores two products with respect to different evidence
16:                   n . val 1 c ch ( n ) c . val 1
17:                   n . val 2 c ch ( n ) c . val 2
18:                    end if
            Case III: Internal node dependent on U
19:            else if  vars ( n ) U  then U -dependent node stores one max or product
20:                    if n is a sum node then
21:                      n . val max c ch ( n ) R a t i o ( c ) ▹ replace sum with max
22:                    else if n is a product node then
23:                   n . val c ch ( n ) R a t i o ( c )
24:                    end if
25:            end if
26:    end for
27:
28:         r root node of AC
29:        return  r . val
30:end procedure
31:
32:function Ratio(c)
33:        if node c has two values then
34:                    return  c . val 1 / c . val 2
35:        else
36:                    return  c . val
37:        end if
38:end function
To explain how Algorithm 4 works, let us partition the nodes in AC into two sets. Let AC U be the set of nodes that depend on U and AC V be the set of nodes independent of U , i.e., AC U = { n AC : vars ( n ) U } and AC V = { n AC : vars ( n ) U = } . Conceptually, Algorithm 4 performs two evaluations for U -independent nodes AC V . In the first pass, we evaluate AC V bottom-up under input e 1 e 2 . This yields a projected circuit AC U ( U ) with parametrization Θ 1 , which computes Pr ( U , e 1 e 2 ) and is deterministic. In the second pass, we evaluate AC V bottom-up under input e 2 . This yields the same projected circuit AC U ( U ) with parametrization Θ 2 , which computes Pr ( U , e 2 ) and is deterministic.
Algorithm 4 implements these two passes efficiently in a single bottom-up traversal by having every node n AC V store two values ( val 1 and val 2 ). The indicators of V are set to two different inputs: val 1 corresponding to evidence e 1 e 2 and val 2 corresponding to evidence e 2 (Line 5). Internal nodes in AC V then evaluate the pair ( val 1 , val 2 ) side by side by applying the same arithmetic operation twice: +-nodes compute two sums and ∗-nodes compute two products (Line 12–17). After this step, every node in AC V has been reduced to a pair of constants, and these constants serve as parameters Θ 1 and Θ 2 for U -dependent nodes AC U . Under parametrization Θ 1 and Θ 2 , AC U computes the two marginals Pr ( U , e 1 e 2 ) and Pr ( U , e 2 ) , respectively, and is deterministic. What we need is Pr ( e 1 | U , e 2 ) = Pr ( U , e 1 e 2 ) / Pr ( U , e 2 ) . By Theorem 7, this can be achieved by dividing corresponding parameters in Θ 1 and Θ 2 . As a result, AC U ( U ) with parametrization Θ 3 must compute Pr ( e 1 | U , e 2 ) and remain deterministic. In Algorithm 4, this division is performed on the fly. Whenever a U -dependent node consumes a child c that still carries two values, we replace that child’s value by the ratio c . val 1 / c . val 2 , as shown in Line 21 and 23. We finally evaluate AC U bottom-up while setting all indicates of U to 1 (Line 7) and replacing every +-node in AC U with a max-node (Line 21). The R-MAP probability is returned at the root.
We now have the following result, which follows directly from the above discussion.
Theorem 8.
Consider a decomposable and smooth AC ( X ) that represents distribution Pr ( X ) , and let U , E 1 , E 2 be disjoint subsets of variables X . If AC is U -deterministic, then for any evidence e 1 and e 2 , running RMAP_AC (Algorithm 4) on input ( AC , U , e 1 , e 2 ) returns the R-MAP probability Pr ( e 1 | U , e 2 ) in time linear in the AC size.

7. Empirical Evaluation

In this section, we provide an empirical study of the two algorithms we proposed for solving unit selection problems: the VE-based RMAP_VE (Section 5.1) and the circuit-based RMAP_AC (Section 6.3). The experiments are conducted on randomly generated SCMs, and the task is to find the optimal unit for the benefit function defined in Equation (1). Our experiments will serve two purposes. First, in Section 7.2, we evaluate the asymptotic complexity of RMAP_VE by measuring the U -constrained treewidth of the constructed objective model that VE operates on, without actually running VE on large instances. This allows us to validate the theoretical bounds established in Section 5.2. We show both analytically and empirically that for a broad class of SCMs, although RMAP_VE can perform significantly better than a baseline search method, its computational cost would still exhibit an exponential growth as the SCM size and the number of unit variables increase. Second, in Section 7.3, we apply both RMAP_VE and RMAP_AC to sampled instances to find the optimal unit—the former operating on the objective model and the latter operating on a decision-AC compiled from this model—and compare their actual runtime and complexity. This allows us to demonstrate the significant speedup provided by compilation and to show that the circuit-based method is not necessarily bounded by the U -constrained treewidth in the same manner as the VE-based method.

7.1. Synthetic SCM Benchmarks and Their Hardness

We next describe our procedures used to generate random SCMs and unit selection problem instances. In particular, we characterize a class of problems for which the U -constrained treewidth is guaranteed to be no smaller than the number of unit variables, | U | , making them hard for VE-based methods such as RMAP_VE to solve. The random SCMs we use in this experiment resemble this class of problems, given how they are constructed.
We generate random SCMs according to the method in [37]. This method first generates a random DAG G 0 with n binary nodes and each node having a maximum number of parents p = 6 . We then convert G 0 into SCM G by adding a unique root parent for each internal node in G 0 . The resulting DAG G tends to have many roots, which is meant to mimic the structure of SCMs commonly used for counterfactual reasoning. Given a random SCM structure, we randomly select different percentages u r of roots to be unit variables U . We assume the objective function given in Equation (1). This function has a single outcome variable Y, which we randomly choose from the SCM leaves. An ancestor (cause) of Y is randomly chosen as the action variable X. Moreover, this function has four components and, as discussed earlier, each component requires only a twin model when constructing the objective model since it does not include evidence variables.
Before we highlight the outcomes of our experiment, we provide some insight into the class of SCMs used and why they are difficult. The second step of SCM construction ensures that each internal node in the DAG has at least one unique parent that is a root by adding additional roots. Thus, if we remove these roots (and their incident edges), the remaining nodes will still be connected. When unit variables U are chosen among such roots, any two unit variables U 1 and U 2 are connected by a path U 1 U 2 that goes through only non-unit variables (plus two endpoints U 1 and U 2 ). Any U -constrained elimination order must eliminate non-unit variables first, and as these variables are being eliminated, fill-in edges are gradually added along such paths in the corresponding moral graph of the DAG. By the time all non-unit variables are eliminated, there must be a direct edge between every pair of U 1 and U 2 in the moral graph, so U forms a clique of size | U | . This implies that any U -constrained elimination order has width at least | U | . This observation can be abstracted into the following lemma:
Definition 9.
Consider a connected DAG G and a subset U  of its roots. We say that  U  are external to G if the DAG remains connected after removing nodes  U  and all their incident edges.
Markovian SCMs (each root node has a single child) satisfy the above condition.
Lemma 2.
Consider a connected SCM G, a subset U of its roots, and a U -constrained elimination order π with width w. If U are external to G, then w | U | .
The proof of this Lemma is provided in Appendix L. The main insight here is that MAP_VE and RMAP_VE must be exponential in the number of unit variables for this class of SCMs (and unit variables) identified by Definition 9.

7.2. Complexity Analysis of RMAP_VE

We provide next an experiment in which we compare the asymptotic complexities of three algorithms on the class of synthetic SCMs discussed in Section 7.1: (1) MAP_VE (Algorithm 1) for computing MAP (operates on an SCM); (2) RMAP_VE (Algorithm 3) for solving unit selection (operates on an objective model); and (3) a baseline method for solving unit selection by exhaustive search (operates on a twin model). The goal of this experiment is not to compare the actual runtime of these algorithms, but to compare the structural quantities that dominate their complexities. These quantities can be computed directly from the structure of SCM, without running VE.
  • MAP_VE: The time complexity is O ( n · exp ( w ) ) , where n is the number of SCM nodes and w is the width of a U -constrained elimination order for the SCM.
  • RMAP_VE: The time complexity is O ( n 1 · exp ( w 1 ) ) , where n 1 is the number of nodes in the objective model and w 1 is the width of a U -constrained elimination order for the objective model.
  • Baseline: The baseline method enumerates every instantiation u and returns the one maximizing the objective L ( u ) . Its time complexity is O ( n 2 · exp ( w 2 ) ) , where n 2 is the number of nodes in the twin model used to evaluate L ( u ) and w 2 = | U | + the width of an unconstrained elimination order for the twin model.
Hence, we compare the complexities of these three algorithms by reporting the number of nodes n, n 1 , n 2 and the corresponding widths w, w 1 , w 2 . These are depicted in Table 1, which also reports the number of SCM roots (R) and the percentage of roots used as unit variables ( u r ). We note that all elimination orders and width are computed using the minfill heuristic [54]. We do not prune the SCMs used by MAP_VE, the objective models used by RMAP_VE, or the twin models used by the baseline method (see [15] (Ch. 6)); thus, the choice of interventional variables does not affect our complexity analysis (no evidence variables in the objective function of Equation (1)).
We can now highlight the patterns in Table 1. The complexities of MAP_VE and RMAP_VE are relatively close, with the latter being more expensive than the former. Moreover, the gap between them narrows as the number of SCM variables (n) and the number of unit variables ( u r ) increase. Note that according to Theorem 6, w 1 / w 2 ; yet, Table 1 shows that this ratio can be significantly smaller than 2. Finally, the baseline method is significantly worse than RMAP_VE, and the gap between the two grows as the number of SCM variables (n) and unit variables ( u r ) increases.
We close this discussion by identifying a class of problems with an unbounded number of unit variables U yet a bounded U -constrained treewidth. This class is depicted in Figure 5. The U -constrained treewidth is 3, which can be shown using the U -constrained elimination order S 1 , ,   S n , , U 1 , , U n . This is a class of problems for which unit selection using RMAP_VE is tractable even when the number of unit variables is unbounded, assuming one uses a suitable objective function (e.g., the benefit function of [18] given in Equation (3)).

7.3. Performance: RMAP_VE vs. RMAP_AC

We now evaluate the actual runtime and performance of the two proposed algorithms, RMAP_VE and RMAP_AC, for unit selection on the synthetic SCM benchmark. Our implementation of RMAP_AC is on top of the ACE system (http://reasoning.cs.ucla.edu/ace/ (accessed on 18 February 2026)), which we use to compile the objective model into a decision-AC, and then evaluate the AC by the two-pass traversal, as described in the previous section.
For each problem instance, we construct an objective model G by composing triplet-models G 1 , , G 4 , one for each component in the benefit function, as discussed earlier; see [26] for more details. We then run ACE_RMAP on G to find the optimal units and compare its results against VE_RMAP implemented in NumPy. The computation for each instance is given 10 min to complete. For each problem instance, we report the execution time of ACE_RMAP and VE_RMAP. For ACE_RMAP, it also includes the compile time of the decision-AC. We also report the size of the circuit generated by ACE (ac_size), and the total size of all factors generated by VE (ve_size), which are two comparable parameters that measure the total number of arithmetic operations required by ACE_RMAP and VE_RMAP, respectively. We also report the approximate constrained treewidth (tw) of G , which is computed using minfill heuristics [54] to find a constrained elimination order for VE_RMAP.
For each SCM size n { 10 , 15 , 20 , 25 , 30 , 35 , 40 } , we generate 25 instances and report the average statistics in Table 2. We highlight the patterns from the statistics. First, as n increases, the time and the number of operations of VE_RMAP grow exponentially and become impractical after n > 30 (our implementation runs out of memory since NumPy does not support ndarrays with > 32 dimensions). This is predicted as VE_RMAP is purely structure-based and must be exponential in the constrained treewidth (tw). Second, ACE_RMAP is much more efficient than VE_RMAP, leading to orders-of-magnitude speedups as a result of exploiting the high degree of local (parameteric) structure in the objective model (e.g., 0/1 parameters, context-specific independence, parameter equality). This enables ACE_RMAP to support very large and dense models (with t w > 30 ) that are normally out of reach if such a parametric structure is not exploited.

8. Case Study

In this section, we demonstrate the utility of optimizing causal objective functions by providing case studies in ecology. We frame real-world problems in the domain as unit selection problems, using objective functions beyond the form of the benefit function (Equation (1)). We then apply the algorithms developed in Section 5 and Section 6 to solve these problems.

8.1. Coral Reef Regime Shifts

We consider a case study in climate-mediated coral reef regime shifts. The outcome variable Y represents whether a regime shift occurs ( Y = 1 ) or not ( Y = 0 ). In the previous study of [55], variables assumed to be relevant to regime shift were whether it was a marine protected area (MPA), herbivore biomass, wave exposure, initial macroalgae, depth, nutrients, branching coral, and structural complexity. A causal DAG, Figure 6, was proposed to capture how these variables interact. In this model, Depth (D), MPA (P), and Wave Exposure (W) are stable properties and can be used to identify a particular reef type, and therefore we choose them as the unit variables U . Nutrients (N), Initial Macroalgae (M), and Herbivore Biomass (H) describe the local environment of a reef and are variables that one can possibly intervene on, and therefore we choose them as treatment variables.
The question we are interested in is retrospective: Among reefs that did shift ( Y = 1 ), which reef types ( u ) would have been most likely not to shift ( Y = 0 ) had we intervened on one of the three treatment variables N , M , H ? This question can be answered by optimizing the following causal objective function:
L ( u ) = p 1 Pr ( Y N = 0 = 0 | Y = 1 , u ) + p 2 Pr ( Y M = 0 = 0 | Y = 1 , u ) + p 3 Pr ( Y H = 1 = 0 | Y = 1 , u )
where unit variables are U = { Depth , MPA , Wave Exposure } . The interventions N = 0 , M = 0 , H = 1 correspond to setting Nutrients = low , Initial Macroalgae = low , and Herbivore Biomass = high , respectively. The weights p 1 , p 2 , p 3 can be viewed as prior probabilities over the three possible intervention candidates, and may be chosen to be inversely related to the intervention cost. In our experiment, we initialize them as [ 0.3 , 0.1 , 0.6 ] .
This objective function involves three counterfactual components and is different from the benefit function in two ways. First, each component involves a distinct treatment variable rather than a single, shared treatment variable; second, each component involves evidence that the reef did shift in reality. Despite this additional expressiveness, it falls into our considered class of causal objective functions in Equation (2).

8.2. Learning SCM from Data

We next learn a fully specified, discrete SCM that is consistent with the causal DAG proposed by [55] and the observational data in their Seychelles dataset, so that we can apply our unit selection algorithms on the SCM. The dataset contains 21 reef sites, and is available at https://doi.org/10.6084/m9.figshare.14981235 (accessed on 18 February 2026). Each instance provides a complete observation of all nine variables in the causal DAG shown in Figure 6. Most of these variables are continuous. Recall from Section 2 that in SCM, uncertainties are represented only through root (exogenous) variables, while interval (endogenous) variables must be deterministic functions of their parents. To obtain such an SCM from the given DAG and data, we proceed in the following four steps:
  • Construct the SCM structure. Our starting point is the DAG in Figure 6. For each of the six internal variables X, we add an additional root variable U X (often called a background variable), which is responsible for capturing the uncertainty in X | P X , where P X are the parents of X in the DAG. This resulted in a Markovian SCM with 15 variables in total: 9 observed variables and 6 hidden root variables.
  • Discretize the observed data. We convert each observed variable into a binary state space using simple thresholds derived from the data. Regime Shift (Y) and Marine Protected Area (P) are already binary.
  • Learn a causal Bayesian Network (BN) over observed variables. We learn a causal BN with the DAG structure before adding hidden roots, from the discretized data. For each variable X in the DAG, we learn its CPT Pr ( X | P X ) using a maximum likelihood (MLE) estimate with uniform smoothing. The result of this step is a fully parametrized BN over the observed variables.
  • Convert the BN to an SCM. Finally, we convert this learned BN over observed variables into an SCM over both observed variables and hidden roots U X . Specifically, for each internal variable X, we introduce a hidden root U X , and construct Pr ( U X ) with a deterministic function f X ( P X , U X ) such that after marginalizing out U X , it produces exactly the same CPT distribution Pr ( X | P X ) learned in the previous step. We do this using an exact inverse–CDF transformation procedure, which is more efficient than the classical construction in [17] in terms of the number of states used by hidden variables U X .
In general, this conversion from BN to SCM is not unique, but the resulting SCM will be consistent with the given DAG and the data over observed variables. We further acknowledge that the resulting SCM would require domain validation, but our goal here is to use this SCM mainly for an illustrative purpose and a computational evaluation.

8.3. Experimental Results

In this section, we apply our unit selection algorithms RMAP_VE (Section 5.1) and RMAP_AC (Section 6.3) to the coral reef SCM learned in the previous section, using the causal objective function in Equation (7). We report the optimal unit returned by our solver, the score of every unit instantiation, and illustrate the auxiliary models used to evaluate and optimize this objective function.
Figure 7 shows the twin model used to compute a single counterfactual component, Pr ( Y M = 0 = 0 | Y = 1 , u ) , in the objective function. It consists of two copies of the base SCM in Figure 6: the left copy represents the real world in which the reef is observed to have shifted ( Y = 1 ), while the right copy represents the counterfactual world in which we intervene to set variable Macroalgae (M) to low. The two worlds share all root variables, including unit variables Depth (D), MPA (P), and Wave Exposure (W), as well as the hidden background variables { U X } introduced in Section 8.2 to capture uncertainty. For clarity, the hidden background variables U X are not explicitly shown in this graph. In the counterfactual world, the incoming edges coming to the intervened node M (double-circled) are removed to indicate that its value is set externally rather than observed. This construction allows the counterfactual probability Pr ( Y M = 0 = 0 | Y = 1 , u ) to be computed as a classical associational probability on this twin model, Pr ( [ Y ] = 0 | [ M ] = 0 , Y = 1 , u ) .
Figure 8 shows the objective model used to compute the objective function in Equation (7). It is obtained by combining three twin models, corresponding to the three counterfactual components of the objective function, into a single model. In the figure, each subgraph represents one component: Pr ( Y N = 0 = 0 | Y = 1 , u ) , Pr ( Y M = 0 = 0 | Y = 1 , u ) , and Pr ( Y H = 1 = 0 | Y = 1 , u ) . The mixture node (diamond-shaped) encodes the weights of these three components, so that inference on the objective model directly computes the value of L ( u ) . In this way, optimization of this causal objective function L ( u ) is reduced to a Reverse-MAP query on this objective model, argmax Pr ( [ Y 1 ] = 0 , [ Y 2 ] = 0 , [ Y 3 ] = 0 [ N 1 ] = 0 , [ M 2 ] = 0 , [ H 3 ] = 1 , Y 1 = 1 , Y 2 = 1 , Y 3 = 1 ) . For details of this objective model construction, see Section 4.
We then run our RMAP_VE and RMAP_AC solvers on the objective model in Figure 8 to solve the unit selection problem under the objective in Equation (7). The VE solver finishes in 0.151 s, while the AC solver finishes in 0.644 s. In this case, the AC solver does not yield a speedup, due to the associated overhead, because the used model is quite small: the base SCM has only 15 variables. Table 3 reports the computed scores for all eight possible units, that is, all instantiations of the unit variables U = { Depth , MPA , WaveExposure } under this objective.
The optimal unit u is ( 1 , 0 , 1 ) , corresponding to deep reefs outside MPAs with high wave exposure, with objective value L ( u ) = 0.138 . To interpret this quantity, it means that among reefs that did shift in reality and satisfy (Depth, MPA, WaveExposure) = (high, no, high), about 13.8 % would be expected to avoid shifting if one of the three interventions were applied: reducing nutrients, reducing macroalgae, or increasing herbivore biomass. We also observe that this unit achieves the highest score on two of the three components in the objective, Pr ( Y N = 0 = 0 | Y = 1 , u ) and Pr ( Y H = 1 = 0 | Y = 1 , u ) . Since the herbivore biomass intervention ( H = 1 ) has the largest weight in the objective, this component contributes the most to the final ranking of units.
We finally discuss several qualitative patterns in Table 3. First, reef types with Depth = 1 tend to achieve higher objective values than reef types with Depth = 0, suggesting that deeper reefs are more responsive to intervention under the learned SCM. This is consistent with the finding in a previous study [55] that deeper reefs are more resilient. Second, the effect of MPA is relatively small: for fixed Depth and Wave Exposure, changing the MPA state does not substantially improve the objective and sometimes decreases it. This is also consistent with the previous study. Third, the Wave Exposure variable interacts strongly with Depth. For shallow reefs, Wave Exposure = 1 often leads to low objective values, while for deep reefs, the combination Depth = 1 and Wave Exposure = 1 achieves the highest score overall.

9. Conclusions

We presented an algorithmic treatment of the problem focusing on optimization over units, which complements existing studies. We assumed a fully specified structural causal model so point values of causal objective functions can be obtained, allowing us to entertain a broader class of functions than is normally considered. Under this assumption, we introduced a reduction from optimizing this class of causal objective functions to optimizing a classical associational probability on a meta-model, called the objective model. We showed that the unit selection problem with this class of objective functions is NP PP -complete, similar to the classical MAP problem, and identified an intuitive condition under which it is NP-complete. In the process, we defined a new inference problem, Reverse-MAP, which captures the essence of unit selection more than MAP does.
On the algorithmic side, we proposed two exact algorithms for solving the unit selection problem by solving Reverse-MAP on the objective model. The first algorithm is based on Variable Elimination. We characterized its complexity in terms of treewidth, while relating this complexity to that of MAP inference. The second algorithm is based on compiling the objective model into a special class of tractable arithmetic circuits, called decision-ACs. We showed that if a decision-AC is constructed subject to specific constraints, then the optimal unit can be computed in time linear in the AC size. We finally demonstrate the performance of our proposed algorithms on randomly generated SCMs and their practical utility by including a case study on a real-world ecology problem.

Author Contributions

Conceptualization, H.H. and A.D.; Methodology, H.H. and A.D.; Software, H.H.; Validation, H.H.; Formal analysis, H.H.; Investigation, A.D.; Resources, A.D.; Writing—original draft, H.H. and A.D.; Writing—review & editing, H.H. and A.D.; Supervision, A.D.; Project administration, A.D.; Funding acquisition, A.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research has been partially supported by ONR grant N000142212501.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

We thank Hana Co for proposing the coral reef case study and the particular version of causal objective function used in this case study.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Proof of Theorem 1

The proof of this theorem requires a lemma, which requires the following definition. We will say that a set of variables Z  decomposes a DAG if removing the outgoing edges from Z splits the DAG into at least two disconnected components.
Lemma A1.
Consider an SCM G with distribution Pr and three disjoint sets of variables X , Y , Z . Suppose Z decomposes G into disconnected components G 1 and G 2 . If X 1 , Y 1 are subsets of X , Y pertaining to G 1 , and X 2 , Y 2 are subsets of X , Y pertaining to G 2 , then Pr ( y | x , z ) = Pr ( y 1 | x 1 , z ) Pr ( y 2 | x 2 , z ) .
Proof. 
Since Z decomposes G, we have dsep G ( X 1 , Z , X 2 ) and dsep G ( X 1 Y 1 , Z , X 2 Y 2 ) . We have:
Pr ( y | x , z ) = Pr ( y , x | z ) Pr ( x | z ) = Pr ( y 1 , y 2 , x 1 , x 2 | z ) Pr ( x 1 , x 2 | z ) = Pr ( y 1 , x 1 | z ) Pr ( y 1 , x 1 | z ) Pr ( x 1 | z ) Pr ( x 2 | z ) = Pr ( y 1 , x 1 | z ) Pr ( x 1 | z ) Pr ( y 2 , x 2 | z ) Pr ( x 2 | z ) = Pr ( y 1 | x 1 , z ) Pr ( y 2 | x 2 , z )
Equation (A1) follows from dsep G ( X 1 , Z , X 2 ) and dsep G ( X 1 Y 1 , Z , X 2 Y 2 ) . This concludes our proof. Although we only consider the case of two subnetworks here, it is easy to see that this lemma generalizes to an arbitrary number of subnetworks decomposed by Z . □
We are now ready to prove Theorem 1. By construction of G , U { H } decomposes G into its n components G 1 , G 2 , G n . We have:
  Pr ( y , w x , v , e , u ) = i = 1 n Pr ( y , w , h i x , v , e , u ) = i = 1 n Pr ( y , w x , v , e , u , h i ) Pr ( h i x , v , e , u ) (A2) = i = 1 n Pr ( y , w x , v , e , u , h i ) Pr ( h i ) (A3) = i = 1 n j = 1 n Pr ( y j , w j x j , v j , e j , u , h i ) Pr ( h i ) (A4) = i = 1 n j i p r ( y j , w j x j , v j , e j , u , h i ) Pr ( y i , w i x i , v i , e i , u , h i ) Pr ( h i ) (A5) = i = 1 n j i 1.0 Pr ( y i , w i x i , v i , e i , u ) w i   = i = 1 n w i Pr ( y x i i , w v i i e i , u ) (A6) = L ( u )
Equation (A2) follows since the auxiliary root H is d-separated from X V E U . Equation (A3) follows from Lemma A1 since U { H } decomposes G such that all triplet models are disconnected. Equation (A4) follows from the construction of the new CPTs of Y i and W i : if H = h i , then the original CPTs of Y i and W i are preserved, and the values of Y j and W j are fixed to y j and w j for all j i . Equation (A5) follows from the property of the triplet network.

Appendix B. Example for MAP and Reverse-MAP

Consider the simple model in Figure A1. We have argmax u Pr ( u , v 1 ) = u 2 for MAP while argmax u Pr ( v 1 | u ) = u 1 for R-MAP.
Figure A1. An example illustrating the difference between MAP and R-MAP (a) SCM; (b) CPT of U; (c) CPT of V.
Figure A1. An example illustrating the difference between MAP and R-MAP (a) SCM; (b) CPT of U; (c) CPT of V.
Entropy 28 00515 g0a1

Appendix C. Proof of Corollary 1

We can reduce Reverse-MAP argmax u Pr ( e 1 | u , e 2 ) to unit selection by choosing an objective function in the form of Equation (2) with the following settings: n = 1 , w 1 = 1 , X 1 = { } , Y 1 = E 1 and E 1 = E 2 . This is clearly a polynomial-time reduction. We already showed a reduction from unit selection to Reverse-MAP in Theorem 1. Let | G | denote the size of SCM G and n be the number of components in the causal objective function. Here, the size of an SCM is the space needed to store the SCM structure and parameters. For example, if the SCM is represented by a functional Bayesian Network, its size is usually the total number of entries in the network CPTs. By inspecting Definition 2, we can immediately see that the time for constructing the objective model G is O ( n · | G | ) . Moreover, the size of objective model G is also O ( n · | G | ) .

Appendix D. Proof of Theorem 2

Membership in NP PP is immediate. Given an instantiation u of U , it is easy to verify if u is a solution by querying the PP-oracle if Pr ( e 1 | u , e 2 ) > p which is a problem known as D-MAR [15]. To prove hardness, we show that E-MAJSAT [56] can be reduced to D-Reverse-MAP in polynomial time, based on a slight modification of the reduction to classical MAP proposed in [34]. The E-MAJSAT problem is defined as follows. Given a Boolean formula α over Boolean variables Z = U V : Is there an instantiation u of U such that the majority of instantiations v of V satisfy u v α (formula α holds at u v )? We show that we can answer E-MAJSAT by answering D-Reverse-MAP on an SCM G α that simulates the formula α and that can be constructed efficiently. The SCM G α is constructed inductively, as shown in [34] (Ref. [34] intended to construct a Bayesian network, but their construction is an SCM since all internal nodes in the network have functional CPTs), and always has a single leaf node, denoted S α . The construction is based on three rules: (1) If α = X , then G α has a single binary node X with values { 0 , 1 } and a uniform prior so S α = X ; (2) If α = ¬ β , then G α is constructed from G β by adding a binary node S α as a child of S β G β with structural equation S α = 1 S β ; and (3) If α = β γ ( α = β γ ), then G α is constructed from G β and G γ by adding a binary node S α as a child of S β G β and S γ G γ with structural equation S α = S β · S γ ( S α = S β + S γ ). We are now ready for the last step of the proof. Given a Boolean formula α over variables Z = U V , and given its SCM G α that has distribution Pr , we next show that there is an instantiation u such that Pr ( S α = 1 | u ) > 1 / 2 (D-Reverse-MAP query) iff there is an instantiation u such that the majority of instantiations v of V satisfy u v α (E-MAJSAT query). Let | Z | = n and s α denote S α = 1 . By construction of G α [34], we have Pr ( z ) = 1 / 2 n for all instantiations z ; Pr ( s α | z ) = 1 if z α and Pr ( s α | z ) = 0 otherwise. Then Pr ( z , s α ) = Pr ( s α | z ) Pr ( z ) = 1 / 2 n if z α and Pr ( z , s α ) = 0 otherwise. We finally have:
Pr ( s α | u ) = Pr ( u , s α ) Pr ( u ) = v Pr ( u , v , s α ) v Pr ( u , v ) = v : u v α ( 1 / 2 n ) v ( 1 / 2 n ) = card ( { v V : u v α } ) card ( V )
Now that we have shown membership and hardness, D-Reverse-MAP is NP PP -complete.

Appendix E. Proof of Theorem 3

Recall Definition 4 of D-Reverse-MAP: Is there an instantiation u such that Pr ( e 1 | u , e 2 ) > p? Membership in NP is immediate. Since U is the set of exogenous variables, evidence variables E are functionally determined by U . Hence, it is easy to check whether an instantiation u is a solution by first computing the instantiation e of E implied by u (using structural equations) and then checking whether e is consistent with e 1 , e 2 . If the answer is yes, then Pr ( e 1 | u , e 2 ) = 1 , otherwise Pr ( u , e 2 ) = 0 or Pr ( e 1 | u , e 2 ) = 0 . To show hardness, we show that SAT can be reduced to D-Reverse-MAP under the conditions stated in the theorem. Given a Boolean formula α over variables U , we construct an SCM G α as in the proof of Theorem 2. SCM G α has a single leaf node S α and its root nodes are U . By construction of G α , we have Pr ( S α = 1 | u ) = 1 if u satisfies α and Pr ( S α = 1 | u ) = 0 otherwise. By choosing p = 0 , e 1 = { S α = 1 } and e 2 = , the D-Reverse-MAP query (is there u such that Pr ( S α = 1 | u ) > 0 ) answers yes iff there is an instantiation u that satisfies the formula α (SAT query). This concludes our proof.

Appendix F. Review of Elimination Concepts

We review here the standard notions of elimination process, clusters, and moral graphs, which we use in some of the upcoming proofs; see [15] (Ch 9) for a detailed treatment.
The moral graph of an SCM G is obtained from G by adding an undirected edge between every pair of common parents and then undirecting all edges. Eliminating a variable X from a graph G is performed by connecting every pair of neighbors for X in G, and then removing node X from G. Eliminating variables from an SCM G is performed by eliminating variables from its moral graph G . Eliminating variables from a moral graph G using variable order π induces a graph sequence  G = G 1 , , G n where graph G i + 1 is obtained by eliminating variable π ( i ) from G i . We use G i ( X ) to denote X and its neighbors in graph G i . We also use C ( X ) to denote the cluster of variable X, which is X and its neighbors just before eliminating X. If X = π ( i ) , then C ( X ) = G i ( X ) . We also use C i to denote the cluster for X, C ( X ) , in this case.

Appendix G. Proof of Lemma 1

This proof uses the elimination concepts and notations reviewed in Appendix F.
Let G m be the moral graph of G and C i be the cluster induced by eliminating variable X i from G . Let n be the number of variables in G. To prove Lemma 1, it suffices to prove the following statement: C i C i { H } for i = 1 , , n , which we prove next by induction.
Let neigh ( X ) denote the neighbors of X in G m and let neigh ( X ) denote the neighbors of X in G m . Let Z denote the children of H in G . For each Z Z , let P Z denote the parents of Z in G. First, we show the statement holds when i = 1 . When creating G m from G , the introduction of node H would cause two classes of edges that do not exist in G m to be added to G m : (1) ( Z , H ) for Z Z ; (2) ( Y , H ) if Y is a parent of some node Z Z , that is Y and H are common parents of some node Z. This means that before the elimination starts, for any node X, if X Z Z Z P Z , we have neigh ( X ) = neigh ( X ) { H } ; otherwise neigh ( X ) = neigh ( X ) . Hence, C 1 { C 1 } { H } . Consider now the elimination of X i + 1 assume that the statement holds for 1 , 2 , , i . We observe that if C j C j { H } , then the elimination of X j would cause only one type of additional edges to be added to G m , that is ( Y , H ) for Y neigh ( X j ) . This is because the elimination of X j will form a clique among neigh ( X j ) { H } in G m , but neigh ( X j ) already forms a clique after X j is eliminated from G m . This implies that eliminating X j ( j i ) will never cause any additional edge to be added among any two nodes that are both not H (in other words, all additional edges added are incident on H). Thus, before we eliminate X i + 1 , we have neigh ( X i + 1 ) neigh ( X i + 1 ) { H } and this implies C i + 1 C i + 1 { H } which concludes the proof.

Appendix H. Proof of Theorem 5

An N-world model is obtained by creating N copies of a directed acyclic graph (DAG) while joining them so a subset of their roots are shared [37]. Hence, an objective model, as in Definition 2, corresponds to an N-world model except for the addition of mixture node H and its outgoing edges. Before adding the mixture node H, an objective model with n components corresponds to a 3 n -world model so its treewidth is 3 n ( w + 1 ) 1 by Theorem 4. After adding node H, its treewidth is 3 n ( w + 1 ) by Lemma 1.

Appendix I. Proof of Theorem 6

This proof uses the elimination concepts and notations reviewed in Appendix F.
For a node X in an SCM G, we use [ X ] k to denote its k t h duplicate in an n-world model of G. If node X is shared between all n worlds, then [ X ] k = X for all k. For a set of variables X , we use [ X ] k to denote { [ X ] k : X X } .
Let G be an SCM, U be a subset of its roots (unit variables), and let G be a corresponding objective model with n components. Our proof is based on constructing an augmented objective model G by adding edges to G and then showing that the bounds of Theorem 6 hold for G . Our proof is based on Lemmas A2 and A4, which we formally state and prove later:
Lemma A2 complements Theorem 4 by showing that any U -constrained elimination order for an SCM can be converted into a U -constrained elimination order for a corresponding n-world model while preserving the width of the order.
Lemma A4 concerns the augmentation of an SCM by a root node H and some edges that originate from H. In particular, given a U -constrained elimination order of width w for the SCM, the lemma shows how to construct a U -constrained elimination order for its augmentation with width max ( w + 1 , | U | ) .
We start by showing how to construct the augmented objective model G from G . Let H be the mixture node of G and Z = { Y i , W i } i = 1 n be the set of all outcome variables in the objective function of Equation (2). We obtain G by adding to G an edge H Z for each Z Z if such an edge does not already exist in G . The edges of G are a superset of the edges of G , so it suffices to show that the bounds of Theorem 6 hold for G . We will next use G t to denote a triplet (3-world) model of G. We will also use G b to denote the augmentation of G t with mixture node H and edges H Z for Z Z . Note that the augmented objective model G corresponds to n copies of G b that share root nodes U { H } . Hence, G is an n-world model of G b .
Let π be a U -constrained elimination order for G with width w. Since G t is a triplet (3-world) model of G, Theorem 4 tells us that there exists an elimination order π t of G t with width w t such that w t 3 w + 2 (order π t will also be U -constrained). Recall that G b is obtained from G t by adding a root node H and some edges that emanate from H. By Lemma A4, there exists an elimination order π b for G b with width w b such that w b max ( w t + 1 , | U | ) = max ( 3 w + 3 , | U | ) . Moreover, if the objective function has a single outcome variable Y, then H has a single child Y in G b , so, also by Lemma A4, we have w b 3 w + 3 . Since G is an n-world model of G b based on roots U { H } of G b , we have w = w b by Lemma A2. In summary, we have w w max ( 3 w + 3 , | U | ) . If the objective function has a single outcome variable, we have w 3 w + 3 . This concludes the proof of Theorem 6.
We will next formally state and prove Lemmas A2 and A4, which we used in the above proof.
Lemma A2.
Consider an SCM G, a subset U of its roots, and a corresponding n-world model G for G that shares U . If w is the width of a U -constrained elimination order π for G, and w is the width of the corresponding U -constrained elimination order π for G , then w = w .
Given an elimination order π for an SCM G, we can convert it into a corresponding elimination order π for its n-world model G (referenced in the above lemma) by replacing each variable X U in π with its duplicates [ X ] 1 , [ X ] 2 , , [ X ] n , as in Definition 2 in [37]. If π is U -constrained, then π will also be U -constrained. Moreover, we define a graph sequence for the n-world model G 1 , G 2 , , G n where G 1 is the moral graph of G , and G i + 1 is obtained by eliminating all duplicates of variable π ( i ) , i.e., [ π ( i ) ] 1 , [ π ( i ) ] 2 , , [ π ( i ) ] n , from G i .
Proof. 
Suppose we eliminate variables from G / G using orders π / π . We claim that at every elimination step i, the following properties hold:
(A)
For each node X U , G i ( [ X ] k ) = [ G i ( X ) ] k
(B)
For each node U U , G i ( U ) = k = 1 n [ G i ( U ) ] k
We next show that properties (A), (B) imply w = w and then prove these properties. Let Y = π ( i ) . If Y U , then when its duplicate [ Y ] k is eliminated from G , we have C ( [ Y ] k ) = [ C ( Y ) ] k . If Y U , then when Y is eliminated from G , we have C ( Y ) = k = 1 n [ G i ( Y ) ] k = G i ( Y ) = C ( Y ) since all non-shared nodes have been eliminated before Y, i.e., [ G i ( Y ) ] k = G i ( Y ) . This means that the cluster induced by eliminating a variable from G always has the same size as the cluster induced by eliminating the corresponding variable from G, which implies w = w .
We next prove properties (A), (B) by induction. By definition of an n-world model, these properties hold initially for G 1 . Suppose they hold for G i and consider G i + 1 . Let Y = π ( i ) . Then G i + 1 is the result of eliminating nodes [ Y ] 1 , , [ Y ] n from G i . We consider two cases.
Case:  Y U . Consider each node Z in G i . If Z is not a neighbor of [ Y ] 1 , , [ Y ] n in G i , then G i + 1 ( Z ) will not be affected by the elimination of [ Y ] 1 , , [ Y ] n and the properties hold by the induction hypothesis. Otherwise, node Z falls into two cases: (A) a duplicate [ X ] k of a node X U , (B) a shared node U U .
(A)
by the induction hypothesis, neighbors of [ X ] k in G i must belong to the k-th world, so [ X ] k can only be a neighbor of the k-th duplicate [ Y ] k . This means that G i + 1 ( [ X ] k ) can only be affected by the elimination of [ Y ] k . By the definition of Variable Elimination, we have:
G i + 1 ( [ X ] k ) = G i ( [ X ] k ) G i ( [ Y ] k ) { [ Y ] k } = [ G i ( X ) ] k [ G i ( Y ) ] k { [ Y ] k } by the induction hypothesis = [ G i ( X ) G i ( Y ) { Y } ] k = [ G i + 1 ( X ) ] k by definition of Variable Elimination
This proves property (A).
(B)
by the induction hypothesis, U must be a neighbor of all duplicates [ Y ] 1 , , [ Y ] n . We have:
G i + 1 ( U ) = G i ( U ) k = 1 n G i ( [ Y ] k ) { [ Y ] k } k = 1 n = k = 1 n [ G i ( U ) ] k k = 1 n [ G i ( Y ) ] k { [ Y ] k } k = 1 n by the induction hypothesis = k = 1 n [ G i ( U ) ] k [ G i ( Y ) ] k { [ Y ] k } = k = 1 n [ G i ( U ) G i ( Y ) { Y } ] k = k = 1 n [ G i + 1 ( U ) ] k by definition of Variable Elimination
This proves property (B).
Case:  Y U . In this case, G i only contains nodes in U . Property (A) holds trivially. And the relation in property (B) reduces to G i ( U ) = k = 1 n [ G i ( U ) ] k = G i ( U ) . By the induction hypothesis, we know G i = G i and thus G i + 1 = G i + 1 . Property (B) holds. This concludes the proof. □
The proof of Lemma A4 requires the following result on eliminating variables from graphs.
Lemma A3.
Consider a DAG G, a subset U of its nodes, and a node H in G where H U . Let G 1 be the moral graph of G, and G 2 be the result of eliminating all nodes other than { H } U from G 1 . For any node X U , X is adjacent to H in G 2 if and only if there exists a path between X and H in G 1 that does not include a node in U { X } .
Proof. 
We first prove the if direction. Suppose there exists such a path ( X , , Z 1 , Y , Z 2 , , H ) in G 1 . Eliminating node Y from G 1 will lead to a path ( X , , Z 1 , Z 2 , , H ) . Since nodes in U { X } cannot appear along this path, eliminating all nodes other than { H } U will lead to the edge ( X , H ) in G 2 . We next prove the only if direction by contraposition. Suppose there is no path between X and H in G 1 that does not include a node in U { X } . There are two cases: (1) there is no path between X and H; (2) every path between X and H includes at least one node U U { X } , which has the form ( X , , U , , H ) . In the first case, X and H will be disconnected in G 2 . In the second case, eliminating all nodes other than { H } U from such paths will lead to X U H , so X cannot be directly adjacent to H in G 2 . This concludes the proof. □
Lemma A4.
Consider an SCM G and a subset U of its roots. Suppose SCM G is obtained from G by adding a root node H as a parent of some nodes Z in G, where Z U = . Let π be a U -constrained elimination order for G, and let π be a U -constrained elimination order of G obtained from π by placing H just before variables U . If π has width w and π has width w , then w max ( w + 1 , | U | ) . Moreover, if H has a single child in G , then w = w + 1 .
Proof. 
Let X denote variables other than U in G, and let U = U { H } . Suppose we first eliminate variables X , then H, and finally U from G using order π . This results in a graph sequence G 1 , , G j , G j + 1 / 2 , G j + 1 , , G j + k where j = | X | and k = | U | . Here, G j + 1 / 2 is obtained by eliminating all variables X from G 1 , and G j + 1 is obtained by eliminating H from G j + 1 / 2 . We claim:
  • if i j , then for each node X H in G i , we have G i ( X ) G i ( X ) { H } .
  • if i > j , then for each node X H in G i , we have G i ( X ) U . Moreover, if H has a single child in G , then G i ( X ) = G i ( X ) .
We first show that the above claim implies the lemma, and then follow by proving the claim. Suppose we are eliminating variable Y from G . If Y U , then i j and the above claim implies C ( Y ) C ( Y ) { H } . If Y U then i > j and the above claim implies C ( Y ) U , and C ( Y ) = C ( Y ) when H has a single child. This guarantees the statement of the lemma: w max ( w + 1 , | U | ) , and w = w + 1 if H has a single child in G .
We next prove our claim by induction. Let Z denote the children of H in G . When constructing the moral graph G 1 from G , the introduction of node H causes two classes of edges that do not exist in G 1 to be added to G 1 : ( Z , H ) for Z Z , and ( Y , H ) if Y is a parent of some node Z Z , that is Y and H are common parents of some node Z. All of these extra edges are incident on H, meaning that for any node X in G 1 , G 1 ( X ) G 1 ( X ) { H } . Thus, our claim holds for G 1 . Next, assume our claim holds for G i (induction hypothesis) and consider G i + 1 . We have two cases.
Case:  i j . Let Y = π ( i ) . Consider each node X in G i + 1 . If node X is not a neighbor of Y in G i / G i , then X is not affected by the elimination of Y, i.e., G i + 1 ( X ) = G i ( X ) and G i + 1 ( X ) = G i ( X ) . So the claim holds by the induction hypothesis. Otherwise, we can bound G i + 1 ( X ) as follows:
G i + 1 ( X ) = G i ( X ) G i ( Y ) { Y } by the definition of elimination G i ( X ) { H } G i ( Y ) { H } { Y } by the induction hypothesis G i ( X ) G i ( Y ) { Y } { H } G i + 1 ( X ) { H }
Case:  i > j . For this case, G i only contains nodes in U . It is trivial that G i ( X ) U for each node X in G i . Recall that eliminating H from G j + 1 / 2 results in G j + 1 . By the induction hypothesis, all extra edges in G j + 1 / 2 that do not exist in G j + 1 must be incident on H. Consider the special case where H has a single child in G . We claim that in this case, every two nodes in G j + 1 / 2 ( H ) are adjacent in G j + 1 / 2 , meaning that the neighbors of H already form a clique in G j + 1 / 2 . Thus, eliminating H from G j + 1 / 2 will not add any fill-in edges in G j + 1 . This guarantees G j + 1 = G j + 1 , i.e, G i ( X ) = G i ( X ) for all i > = j + 1 . We finally turn to proving this claim by contradiction. Suppose that node U 1 and U 2 are neighbors of H in G j + 1 / 2 but are not adjacent in G j + 1 / 2 . By Lemma A3, in G 1 , there must be a path P 1 between U 1 and H that does not include nodes in U { U 1 } , and a path P 2 between U 2 that does not include nodes in U { U 2 } . Since H is a root and only has one child Z in G , P 1 must have the form ( U 1 , , Z , H ) in G 1 and P 2 must have the form ( U 2 , , Z , H ) in G 1 . Thus, there must be a path ( U 1 , , Z , , U 2 ) in G 1 that does not contain nodes in U { U 1 , U 2 } . By Lemma A3, after eliminating all nodes other than U from G 1 , U 1 and U 2 must be adjacent in G j + 1 . This leads to a contradiction. □

Appendix J. Proof of Proposition 2

Proof. 
Suppose the decision-AC is evaluated at input u * which is some instantiation of U . Consider any +-node n with decision variable X. If X U , it is easy to verify that at most one child of n can be nonzero—the one with indicator λ x * , where x * is the state of X in u * . If X U , we claim that node n cannot depend on U (i.e., vars ( n ) U = ). Hence, this decision-AC is U -deterministic by Definition 8. We prove this claim by contradiction. Suppose node n does depend on some variable U U , which means there is an indicator λ u below n. By condition (2) of Definition 8, this indicator λ u must be attached to some +-nodes m with decision variable U. This implies that m is below n, which contradicts condition (1). □

Appendix K. Proof of Theorem 7

Proof. 
To prove Theorem 7, we need the notion of a subcircuit, which is introduced in [43] and studied extensively in [45].
Definition A1.
Let  AC ( X )  be a decomposable and smooth circuit. A complete subcircuit α of  AC  is obtained by visiting the circuit nodes top-down starting at the root: if a ∗-node is visited, visit all its children, and if a +-node is visited, visit exactly one of its children. The term of α is the set of variable values appearing in indicators of α, and the coefficient of α is the product of all parameters in α.
A complete subcircuit must include exactly one indicator for every variable in X . Hence, the term of each complete subcircuit corresponds to an instantiation x of X , so the subcircuit is called an x -subcircuit. Evaluating AC ( x ) amounts to summing the coefficients of all x -subcircuits. Furthermore, ref. [45] showed that if the circuit is also deterministic, then for any instantiation x of X , if AC ( x ) 0 , there is a unique x -subcircuit whose coefficient is nonzero. Denote this subcircuit by α x . We know α x has coefficient p 1 = Pr 1 ( x ) under Θ 1 and coefficient p 2 = Pr 2 ( x ) under Θ 2 . By construction, α x must have coefficient p 3 = p 1 / p 2 under Θ 3 . Hence, AC ( x ) = p 3 = Pr 3 ( x ) under Θ 3 . This proves Theorem 7 (Without determinism, an AC may have multiple x -subcircuits for a given x , and dividing corresponding parameters may not give the correct result. For a simple example, consider AC ( X ) = a · λ x + b · λ x ¯ + c · λ x . AC is not deterministic; it has two complete subcircuits ( x , a ) and ( x , c ) for x. We have AC ( x ) = a 1 + b 1 under Θ 1 and AC ( x ) = a 2 + b 2 under Θ 2 . After dividing corresponding parameters, AC ( x ) produces a 1 / a 2 + b 1 / b 2 instead of ( a 1 + b 1 ) / ( a 2 + b 2 ) ). □

Appendix L. Proof of Lemma 2

Proof. 
By Lemma A3, every two nodes U 1 and U 2 in S will be adjacent after all nodes other than U are eliminated from G . Thus, nodes in S will form a clique after all nodes other than U are eliminated. This leads to a cluster of size | S | during the elimination process, so | S | is a lower bound for the width of any U -constrained elimination order. □

References

  1. Pearl, J. Causality: Models, Reasoning, and Inference; Cambridge University Press: Cambridge, UK, 2000. [Google Scholar]
  2. Pearl, J.; Mackenzie, D. The Book of Why: The New Science of Cause and Effect; Basic Books: New York, NY, USA, 2018. [Google Scholar]
  3. Bareinboim, E.; Correa, J.D.; Ibeling, D.; Icard, T. On Pearl’s hierarchy and the foundations of causal inference. In Probabilistic and Causal Inference: The Works of Judea Pearl; ACM Books: New York, NY, USA, 2022; pp. 507–556. [Google Scholar]
  4. Pearl, J. Causal diagrams for empirical research. Biometrika 1995, 82, 669–710. [Google Scholar] [CrossRef]
  5. Pearl, J. [Bayesian analysis in expert systems]: Comment: Graphical models, causality and intervention. Stat. Sci. 1993, 8, 266–269. [Google Scholar] [CrossRef]
  6. Spirtes, P.; Glymour, C.N.; Scheines, R. Causation, Prediction, and Search; MIT Press: Cambridge, MA, USA, 2000. [Google Scholar]
  7. Shpitser, I.; Pearl, J. Identification of joint interventional distributions in recursive semi-Markovian causal models. In Proceedings of the AAAI, Boston, MA, USA, 16–20 July 2006; pp. 1219–1226. [Google Scholar]
  8. Imbens, G.W.; Rubin, D.B. Causal Inference in Statistics, Social, and Biomedical Sciences; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar]
  9. Balke, A.; Pearl, J. Probabilistic Evaluation of Counterfactual Queries. In Proceedings of the AAAI; AAAI Press: Washington, DC, USA; The MIT Press: Cambridge, MA, USA, 1994; pp. 230–237. [Google Scholar]
  10. Galles, D.; Pearl, J. An axiomatic characterization of causal counterfactuals. Found. Sci. 1998, 3, 151–182. [Google Scholar] [CrossRef]
  11. Shpitser, I.; Pearl, J. Complete Identification Methods for the Causal Hierarchy. J. Mach. Learn. Res. 2008, 9, 1941–1979. [Google Scholar]
  12. Morgan, S.L.; Winship, C. Counterfactuals and Causal Inference: Methods and Principles for Social Research; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar]
  13. Koller, D.; Friedman, N. Probabilistic Graphical Models—Principles and Techniques; MIT Press: Cambridge, MA, USA, 2009. [Google Scholar]
  14. Pearl, J. Probabilistic Reasoning in Intelligent Systems—Networks of Plausible Inference; Morgan Kaufmann Series in Representation and Reasoning; Morgan Kaufmann: San Francisco, CA, USA, 1989. [Google Scholar]
  15. Darwiche, A. Modeling and Reasoning with Bayesian Networks; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
  16. Peters, J.; Janzing, D.; Schölkopf, B. Elements of Causal Inference: Foundations and Learning Algorithms; MIT Press: Cambridge, MA, USA, 2017. [Google Scholar]
  17. Balke, A.; Pearl, J. Counterfactuals and Policy Analysis in Structural Models. In Proceedings of the UAI; Morgan Kaufmann: San Francisco, CA, USA, 1995; pp. 11–18. [Google Scholar]
  18. Li, A.; Pearl, J. Unit Selection Based on Counterfactual Logic. In Proceedings of the International Joint Conference on Artificial Intelligence, Macao, China, 10–16 August 2019; pp. 1793–1799. [Google Scholar]
  19. Li, A.; Pearl, J. Unit Selection with Causal Diagram. In Proceedings of the AAAI; AAAI Press: Washington, DC, USA, 2022; pp. 5765–5772. [Google Scholar]
  20. Li, A.; Pearl, J. Unit Selection with Nonbinary Treatment and Effect. arXiv 2022, arXiv:2208.09569. [Google Scholar] [CrossRef]
  21. Li, A.; Pearl, J. Unit Selection: Case Study and Comparison with A/B Test Heuristic. arXiv 2022, arXiv:2210.05030. [Google Scholar] [CrossRef]
  22. Li, A.; Jiang, S.; Sun, Y.; Pearl, J. Unit Selection: Learning Benefit Function from Finite Population Data. arXiv 2022, arXiv:2210.08203. [Google Scholar] [CrossRef]
  23. Dawid, P.; Musio, M.; Murtas, R. The Probability of Causation. Law Probab. Risk 2017, 16, 163–179. [Google Scholar] [CrossRef]
  24. Mueller, S.; Li, A.; Pearl, J. Causes of Effects: Learning Individual Responses from Population Data; Technical Report R-505; Forthcoming, Proceedings of IJCAI-2022; Department of Computer Science, University of California: Los Angeles, CA, USA, 2021; Available online: http://ftp.cs.ucla.edu/pub/stat_ser/r505.pdf (accessed on 18 February 2026).
  25. Li, A.; Jiang, S.; Sun, Y.; Pearl, J. Learning Probabilities of Causation from Finite Population Data; Technical Report R-519; Department of Computer Science, University of California: Los Angeles, CA, USA, 2022; Available online: http://ftp.cs.ucla.edu/pub/stat_ser/r519.pdf (accessed on 18 February 2026).
  26. Huang, H.; Darwiche, A. An Algorithm and Complexity Results for Causal Unit Selection. In Proceedings of the 2nd Conference on Causal Learning and Reasoning, Tübingen, Germany, 11–14 April 2023. [Google Scholar]
  27. Huang, H.; Darwiche, A. Causal Unit Selection using Tractable Arithmetic Circuits. In Proceedings of the International FLAIRS Conference Proceedings, Sandestin Beach, FL, USA, 19–21 May 2024; Volume 37. [Google Scholar]
  28. Halpern, J.Y. Axiomatizing causal reasoning. J. Artif. Intell. Res. 2000, 12, 317–337. [Google Scholar] [CrossRef]
  29. Pearl, J.; Glymour, M.; Jewell, N.P. Causal Inference in Statistics: A Primer; John Wiley & Sons: Hoboken, NJ, USA, 2016. [Google Scholar]
  30. Avin, C.; Shpitser, I.; Pearl, J. Identifiability of Path-Specific Effects. In Proceedings of the IJCAI; Morgan Kaufmann: San Francisco, CA, USA, 2005; pp. 357–363. [Google Scholar]
  31. Tian, J.; Pearl, J. Probabilities of causation: Bounds and identification. Ann. Math. Artif. Intell. 2000, 28, 287–313. [Google Scholar] [CrossRef]
  32. Pearl, J. Physical and Metaphysical Counterfactuals: Evaluating Disjunctive Actions. J. Causal Inference 2017, 5, 20170018. [Google Scholar] [CrossRef]
  33. Shimony, S.E. Finding MAPs for belief networks is NP-hard. Artif. Intell. 1994, 68, 399–410. [Google Scholar] [CrossRef]
  34. Park, J.D.; Darwiche, A. Complexity Results and Approximation Strategies for MAP Explanations. J. Artif. Intell. Res. (JAIR) 2004, 21, 101–133. [Google Scholar] [CrossRef]
  35. Roth, D. On the Hardness of Approximate Reasoning. Artif. Intell. 1996, 82, 273–302. [Google Scholar] [CrossRef]
  36. Dechter, R. Bucket Elimination: A Unifying Framework for Reasoning. Artif. Intell. 1999, 113, 41–85. [Google Scholar] [CrossRef]
  37. Han, Y.; Chen, Y.; Darwiche, A. On the complexity of counterfactual reasoning. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, Macao, China, 19–25 August 2023; pp. 5676–5684. [Google Scholar]
  38. Chen, Y.; Darwiche, A. On the definition and computation of causal treewidth. In Proceedings of the Uncertainty in Artificial Intelligence, PMLR, Eindhoven, The Netherlands, 1–5 August 2022; pp. 368–377. [Google Scholar]
  39. Darwiche, A. An Advance on Variable Elimination with Applications to Tensor-Based Computation. In ECAI 2020; IOS Press: Amsterdam, The Netherlands, 2020; pp. 2559–2568. [Google Scholar]
  40. Chavira, M.; Darwiche, A. Compiling Bayesian Networks with Local Structure. In Proceedings of the 19th International Joint Conference on Artificial Intelligence (IJCAI), Edinburgh, Scotland, 30 July–5 August 2005; pp. 1306–1312. [Google Scholar]
  41. Huber, D.; Chen, Y.; Antonucci, A.; Darwiche, A.; Zaffalon, M. Tractable bounding of counterfactual queries by knowledge compilation. arXiv 2023, arXiv:2310.03352. [Google Scholar] [CrossRef]
  42. Darwiche, A. A differential approach to inference in Bayesian networks. J. ACM (JACM) 2003, 50, 280–305. [Google Scholar] [CrossRef]
  43. Chan, H.; Darwiche, A. On the Robustness of Most Probable Explanations. In Proceedings of the 22nd Conference in Uncertainty in Artificial Intelligence (UAI), Cambridge, MA, USA, 13–16 July 2006. [Google Scholar]
  44. Poon, H.; Domingos, P.M. Sum-Product Networks: A New Deep Architecture. In Proceedings of the UAI, Barcelona, Spain, 14–17 July 2011; pp. 337–346. [Google Scholar]
  45. Choi, A.; Darwiche, A. On Relaxing Determinism in Arithmetic Circuits. In Proceedings of the Thirty-Fourth International Conference on Machine Learning (ICML), Sydney, Australia, 6–11 August 2017; pp. 825–833. [Google Scholar]
  46. Darwiche, A. Tractable Boolean and Arithmetic Circuits. In Neuro-Symbolic Artificial Intelligence; IOS Press: Amsterdam, The Netherlands, 2021; Volume 342, pp. 146–172. [Google Scholar]
  47. Huang, J.; Chavira, M.; Darwiche, A. Solving MAP Exactly by Searching on Compiled Arithmetic Circuits. In Proceedings of the AAAI, Boston, MA, USA, 16–20 July 2006; Volume 6, pp. 3–7. [Google Scholar]
  48. Pipatsrisawat, K.; Darwiche, A. A new d-DNNF-based bound computation algorithm for functional E-MAJSAT. In Proceedings of the Twenty-First International Joint Conference on Artificial Intelligence; Morgan Kaufmann: San Francisco, CA, USA, 2009. [Google Scholar]
  49. Huang, J.; Darwiche, A. The language of search. J. Artif. Intell. Res. 2007, 29, 191–219. [Google Scholar] [CrossRef]
  50. Chavira, M.; Darwiche, A. Compiling Bayesian Networks Using Variable Elimination. In Proceedings of the 20th International Joint Conference on Artificial Intelligence (IJCAI), Hyderabad, India, 6–12 January 2007; pp. 2443–2449. [Google Scholar]
  51. Darwiche, A. New advances in compiling CNF to decomposable negation normal form. In Proceedings of the European Conference on Artificial Intelligence; IOS Press: Amsterdam, The Netherlands, 2004; pp. 328–332. [Google Scholar]
  52. Choi, Y.; Vergari, A.; Van den Broeck, G. Probabilistic Circuits: A Unifying Framework for Tractable Probabilistic Models; UCLA: Los Angeles, CA, USA, 2020; Available online: http://starai.cs.ucla.edu/papers/ProbCirc20.pdf (accessed on 18 February 2026).
  53. Choi, Y.; Friedman, T.; Van den Broeck, G. Solving marginal map exactly by probabilistic circuit transformations. In Proceedings of the International Conference on Artificial Intelligence and Statistics, PMLR, Virtual, 28–30 March 2022; pp. 10196–10208. [Google Scholar]
  54. Kjærulff, U.B. Triangulation of Graphs-Algorithms Giving Small Total State Space; University of Aalborg: Aalborg, Denmark, 1990. [Google Scholar]
  55. Arif, S.; Graham, N.A.; Wilson, S.; MacNeil, M.A. Causal drivers of climate-mediated coral reef regime shifts. Ecosphere 2022, 13, e3956. [Google Scholar] [CrossRef]
  56. Littman, M.L.; Goldsmith, J.; Mundhenk, M. The computational complexity of probabilistic planning. J. Artif. Intell. Res. 1998, 9, 1–36. [Google Scholar] [CrossRef]
Figure 1. Reducing the counterfactual probability Pr ( y x , y x x , y ) on the model in (a) to an observational probability Pr ( [ y ] , [ [ y ] ] [ x ] , [ [ x ] ] , x , y ) on the model in (c).
Figure 1. Reducing the counterfactual probability Pr ( y x , y x x , y ) on the model in (a) to an observational probability Pr ( [ y ] , [ [ y ] ] [ x ] , [ [ x ] ] , x , y ) on the model in (c).
Entropy 28 00515 g001
Figure 2. An objective model with two components for the SCM in Figure 1a.
Figure 2. An objective model with two components for the SCM in Figure 1a.
Entropy 28 00515 g002
Figure 3. An SCM example illustrating the variable elimination procedure.
Figure 3. An SCM example illustrating the variable elimination procedure.
Entropy 28 00515 g003
Figure 4. An AC that computes factor f ( A , B ) .
Figure 4. An AC that computes factor f ( A , B ) .
Entropy 28 00515 g004
Figure 5. The unit variables are U = U 1 , , U n . The U -constrained treewidth is 3.
Figure 5. The unit variables are U = U 1 , , U n . The U -constrained treewidth is 3.
Entropy 28 00515 g005
Figure 6. Causal DAG for coral reef regime shift from [55]. The outcome variable is Regime Shift. Treatment variables are Nutrients, Initial Macroalgae, and Herbivore Biomass. Unit variables are Depth, MPA, and Wave Exposure.
Figure 6. Causal DAG for coral reef regime shift from [55]. The outcome variable is Regime Shift. Treatment variables are Nutrients, Initial Macroalgae, and Herbivore Biomass. Unit variables are Depth, MPA, and Wave Exposure.
Entropy 28 00515 g006
Figure 7. Twin model for computing Pr ( Y M = 0 = 0 | Y = 1 , u ) , the second component of the coral reef counterfactual objective. Bracketed variables denote duplicate variables in the counterfactual world.
Figure 7. Twin model for computing Pr ( Y M = 0 = 0 | Y = 1 , u ) , the second component of the coral reef counterfactual objective. Bracketed variables denote duplicate variables in the counterfactual world.
Entropy 28 00515 g007
Figure 8. Objective model for the coral reef counterfactual objective. The model contains three counterfactual components, corresponding to G 1 : d o ( N = 0 ) , G 2 : d o ( M = 0 ) , and G 3 : d o ( H = 1 ) . In each component, the left dashed box represents the base world, and the right dashed box represents the counterfactual world. Shared nodes D, P, and W correspond to the unit variables being optimized, and the mixture node (diamond-shaped) encodes a weighted combination of these three counterfactual components. The intervened node in each component is double-circled.
Figure 8. Objective model for the coral reef counterfactual objective. The model contains three counterfactual components, corresponding to G 1 : d o ( N = 0 ) , G 2 : d o ( M = 0 ) , and G 3 : d o ( H = 1 ) . In each component, the left dashed box represents the base world, and the right dashed box represents the counterfactual world. Shared nodes D, P, and W correspond to the unit variables being optimized, and the mixture node (diamond-shaped) encodes a weighted combination of these three counterfactual components. The intervened node in each component is double-circled.
Entropy 28 00515 g008
Table 1. Comparing the complexities of MAP_VE for solving MAP ( n exp ( w ) ), RMAP_VE for solving unit selection ( n 1 exp ( w 1 ) ), and the baseline method for solving unit selection ( n 2 exp ( w 2 ) ). Each data point is an average over 25 runs.
Table 1. Comparing the complexities of MAP_VE for solving MAP ( n exp ( w ) ), RMAP_VE for solving unit selection ( n 1 exp ( w 1 ) ), and the baseline method for solving unit selection ( n 2 exp ( w 2 ) ). Each data point is an average over 25 runs.
ur 20% 40% 60% 80% 100%
n n 2 R n 1 w w 1 w 2 n 1 w w 1 w 2 n 1 w w 1 w 2 n 1 w w 1 w 2 n 1 w w 1 w 2
10146525.57.27.3495.57.48.3465.57.59.3435.57.710.3376.38.312.3
15219827.410.010.6767.410.212.6707.511.014.6648.211.816.6589.612.618.6
20301211610.114.016.011010.114.518.010110.115.421.09510.515.623.08612.816.426.0
25371514011.016.819.713111.017.422.712211.218.425.711312.818.828.710415.919.931.7
30431716311.318.821.615411.419.224.614211.820.728.613313.821.231.612118.021.635.6
35501919012.421.424.217812.421.928.216612.823.532.215415.624.036.214219.623.640.2
40572221813.324.327.820613.624.931.819114.326.636.817917.627.040.816423.026.645.8
45642424614.326.629.823114.427.234.821615.628.939.820120.130.644.818625.629.249.8
Table 2. Performance of ACE_RMAP vs. VE_RMAP on maximizing Pearl’s benefit function. Here n is #nodes we start with to sample SCM and n is #nodes in the sampled SCM eventually. The Done column is the number out of 25 instances that are solved. Each data point is an average over the solved instances.
Table 2. Performance of ACE_RMAP vs. VE_RMAP on maximizing Pearl’s benefit function. Here n is #nodes we start with to sample SCM and n is #nodes in the sampled SCM eventually. The Done column is the number out of 25 instances that are solved. Each data point is an average over the solved instances.
SCMVEACE
nn | U | DoneTime (s)VE_SizetwDoneTime (s)AC_Size
1018.93.0250.49 4.92 × 10 5 12.28252.091595
1528.43.4251.42 9.15 × 10 6 16.88253.314990
2036.84.0254.72 1.02 × 10 8 20.12254.68 1.03 × 10 4
2545.55.32545.90 2.42 × 10 9 24.16255.76 3.90 × 10 4
3054.55.822145.72 8.07 × 10 9 27.362513.62 1.12 × 10 5
3563.77.07274.73 1.05 × 10 10 32.62456.33 3.57 × 10 5
Table 3. Counterfactual scores for all unit instantiations under the coral reef counterfactual objective and its three components. Here, the unit variables are U = ( Depth , MPA , WaveExposure ) . The optimal unit (bold) is ( 1 , 0 , 1 ) , corresponding to deep reefs outside MPAs with high wave exposure.
Table 3. Counterfactual scores for all unit instantiations under the coral reef counterfactual objective and its three components. Here, the unit variables are U = ( Depth , MPA , WaveExposure ) . The optimal unit (bold) is ( 1 , 0 , 1 ) , corresponding to deep reefs outside MPAs with high wave exposure.
DepthMPAWaveExp. P ( Y N = 0 = 0 Y = 1 , u ) P ( Y M = 0 = 0 Y = 1 , u ) P ( Y H = 1 = 0 Y = 1 , u ) L ( u )
0000.00000.18630.05740.0531
0010.00000.09680.00000.0097
0100.00000.22210.01540.0315
0110.00000.05370.00000.0054
1000.01310.03670.07080.0501
1010.13960.08000.14710.1381
1100.01880.03260.01380.0172
1110.02360.03720.05300.0426
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Huang, H.; Darwiche, A. An Algorithmic Treatment of Causal Unit Selection. Entropy 2026, 28, 515. https://doi.org/10.3390/e28050515

AMA Style

Huang H, Darwiche A. An Algorithmic Treatment of Causal Unit Selection. Entropy. 2026; 28(5):515. https://doi.org/10.3390/e28050515

Chicago/Turabian Style

Huang, Haiying, and Adnan Darwiche. 2026. "An Algorithmic Treatment of Causal Unit Selection" Entropy 28, no. 5: 515. https://doi.org/10.3390/e28050515

APA Style

Huang, H., & Darwiche, A. (2026). An Algorithmic Treatment of Causal Unit Selection. Entropy, 28(5), 515. https://doi.org/10.3390/e28050515

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop