Chapter 5

Stochastic Enumeration Method

5.1 Introduction

In this chapter, we introduce a new generic sequential importance sampling (SIS) algorithm, called stochastic enumeration (SE) for counting #P problems. SE represents a natural generalization of one-step-look-ahead (OSLA) algorithms. We briefly introduce these concepts here and defer explanation of the algorithms in detail to the subsequent sections.

Consider a simple walk in the integer lattice c05-math-0001. It starts at the origin (0,0) and it repeatedly takes unit steps in any of the four directions, North (N), South (S), East (E), or West (W). For instance, an 8-step walk could be

equation

We impose the condition that the walk may not revisit a point that it has previously visited. These walks are called self-avoiding walks (SAW). SAWs are often used to model the real-life behavior of chain-like entities such as polymers, whose physical volume prohibits multiple occupation of the same spatial point. They also play a central role in modeling of the topological and knot-theoretic behavior of molecules such as proteins.

Clearly, the 8-step walk above is not a SAW inasmuch as it revisits point c05-math-0003. Figure 5.1 presents an example of a 130-step SAW. Counting the number of SAWs of length c05-math-0004 is a basic problem in computational science for which no exact formula is currently known. The problem is conjectured to be complete in #Pc05-math-0005, that is, the version of #P in which the input consists of binary symbols, see [78] [120]. Though many approximating methods exist, the most advanced algorithms are the pivot ones. They can handle SAWs of size c05-math-0006, see [30] [82]. For a good recent survey, see [121].

Figure 5.1 SAW of length 130.

c05f001

We consider randomized algorithms for counting SAWs of length at least some given c05-math-0007, say c05-math-0008. A natural, simple algorithm goes as follows: it chooses at the current end point of the walk randomly one of the feasible neighbors and moves to it. This is done until either a path of length of c05-math-0009 is obtained or there is no available neighbor. In the latter case, we say that the walk is trapped, or that the algorithm gets stuck. Then, the algorithm returns a zero counting value. Otherwise it returns the product of the consecutive numbers of available neighbors at each step. This is repeated c05-math-0010 times independently; the average is taken as an estimator of the counting problem. Typical features of this algorithm are that

  • it runs a single path, or trajectory;
  • it is sequential, because it moves iteratively from point to point;
  • it is randomized, because the next point is chosen at random (if possible);
  • it is OSLA, because in each iteration it decides how to continue by considering only its nearest feasible points.

Note that any feasible SAW c05-math-0011 of length c05-math-0012 has a positive probability c05-math-0013 of being constructed by this simple algorithm. The main two drawbacks of the algorithm are that

  • the pdf c05-math-0014 is nonuniform on the space of all feasible SAWs of length c05-math-0015, which causes high variance of the associated estimator;
  • it gets stuck easily for large c05-math-0016, cf. [79].

To overcome the first drawback, we suggest in Section 5.2.2 to run multiple trajectories in parallel. This will typically reduce the variance substantially. To eliminate the second drawback, we ask an oracle at each iteration how to continue in order that the walk not be trapped too early. That is, the oracle can foresee which feasible nearest neighbors lead to a trap and which do not. As an example, consider constructing a SAW of length c05-math-0017, then Figure 5.2 shows how the OSLA algorithm can lead to a trap after 15 iterations.

Figure 5.2 SAW trapped after 15 iterations.

c05f002

However, an oracle would, say, after 13 iterations continue to the South rather than to the North. We call such oracle-based algorithms c05-math-0018-step-look-ahead (c05-math-0019SLA), because instances are generated iteratively while having information how to continue without being trapped before the last iteration or step. Thus, it has the advantage of not losing trajectories. Notice that in our example this c05-math-0020SLA algorithm still runs single trajectories, resulting again in high variances of its associated estimator, see Section 5.2.1. Next, we propose to run multiple trajectories in combination with the c05-math-0021SLA oracle. We call this method stochastic enumeration (SE), and we will provide the details and analysis in Section 5.3.

Summarizing, the features of SE are

  • It runs multiple trajectories in parallel, instead of a single one; by doing so, the samples from c05-math-0022 become close to uniform.
  • It employs c05-math-0023-step-look-ahead algorithms (oracles); this is done to overcome the generation of zero outcomes of the estimator.

As a side effect, SE reduces a difficult counting problem to a set of simple ones, applying at each step an oracle. Furthermore, we note that, in contrast to the conventional splitting algorithm of Chapter 4, there is less randomness involved in SE. As a result, it is typically faster than splitting.

A main concern of using oracles deals with its computational complexity. At each iteration, we apply a decision-making oracle because we are only interested in which direction we can continue generating the path without being trapped somewhere later. Thus, we propose directions and wait for yes-no decisions of the oracle. Hence, for problems for which polynomial time decision-making algorithms exist, SE will be applicable and runs fast.

It is interesting to note that there are many problems in computational combinatorics for which the decision-making is easy (polynomial) but the counting is hard (#P-complete). For instance,

1. How many different variable assignments will satisfy a given DNF formula?
2. How many different variable assignments will satisfy a given 2-SAT formula?
3. How many perfect matchings are there for a given bipartite graph?

It was known quite a long time ago that finding a perfect matching for a given bipartite (undirected) graph c05-math-0024 can be solved in polynomial c05-math-0025 time, while the corresponding counting problem, “How many perfect matchings does the given bipartite graph have?” is already #P-complete. The problem of counting the number of perfect matchings is known to be equivalent to the computation of the permanent of a matrix [119].

Similarly, there is a trivial algorithm for determining whether a given DNF form of the satisfiability problem is true. Indeed, in this case we have to examine each clause, and if a clause is found that does not contain both a variable and its negation, then it is true, otherwise it is not. However, the counting version of this problem is #P-complete.

Many #P-complete problems have a fully polynomial-time randomized approximation scheme (FPRAS), which, informally, will produce with high probability an approximation to an arbitrary degree of accuracy, in time that is polynomial with respect to both the size of the problem and the degree of accuracy required [88]. Jerrum, Valiant, and Vazirani [60] showed that every #P-complete problem either has an FPRAS or is essentially impossible to approximate; if there is any polynomial-time algorithm that consistently produces an approximation of a #P-complete problem that is within a polynomial ratio in the size of the input of the exact answer, then that algorithm can be used to construct an FPRAS.

The use of fast decision-making algorithms (oracles) for solving NP-hard problems is very common in Monte Carlo methods; see, for example,

  • Karger's paper [64], which presents an FPRAS for network unreliability based on the well-known DNF polynomial counting algorithm of Karp and Luby [65].
  • The insightful monograph of Gertsbakh and Shpungin [41] in which Kruskal's spanning trees algorithm is used for estimating network reliability.

Our main strategy is as in [41]: use fast polynomial decision-making oracles to solve #P-complete problems. In particular, one can easily incorporate into SE the following:

  • The breadth-first-search procedure or Dijkstra's shortest path algorithm [32] for counting the number of paths in the networks.
  • The Hungarian decision-making assignment problem method [74] for counting the number of perfect matchings.
  • The decision-making algorithm for counting the number of valid assignments in 2-SAT, developed in Davis et al. [35] [36].
  • The Chinese postman (or Eulerian cycle) decision-making algorithm for counting the total number of shortest tours in a graph. Recall that in a Eulerian cycle problem, one must visit each edge at least once.

The remainder of this chapter is organized as follows. Section 5.2 presents some background on the classical OSLA algorithm and its extensions: (i) using an oracle and (ii) using multiple trajectories. Section 5.3 is the main discussion; it deals with both OSLA extensions simultaneously, resulting in the SE method.

Section 5.4 deals with applications of SE to counting in #P-complete problems, such as counting the number of trajectories in a network, number of satisfiability assignments in a SAT problem, and calculating the permanent. Here we also discuss how to choose the number of parallel trajectories in the SE algorithm. Unfortunately, there is no c05-math-0026SLA polynomial oracle for SAW. Consequently, SE is not directly applicable to SAW and we must resort to its simplified (time-consuming) version. This section describes the algorithms; some corresponding numerical results are given in Section 5.5. There we also show that SE outperforms the splitting method discussed in Chapter 4 and SampleSearch method of Gogate and Dechter [56] [57]. Our explanation for this is that SE is based on SIS (sequential importance sampling), whereas its two counterparts are based merely on the standard (nonsequential) importance sampling.

5.2 OSLA Method and Its Extensions

Let c05-math-0027 be our counting quantity, such as,

  • the number of satisfiability assignments in a SAT problem with c05-math-0028 literals;
  • the number of perfect matchings (permanent) in a bipartite graph with c05-math-0029 nodes;
  • the number of SAWs of length c05-math-0030.

We assume, similarly to in Chapter 4, that c05-math-0031 is a subset of some larger but finite sample space c05-math-0032. Let c05-math-0033 be the uniform pdf and c05-math-0034 some arbitrary pdf on c05-math-0035 that is positive for all c05-math-0036, and suppose that we generate a random element c05-math-0037 using these pdfs; then we can write

equation

This special case of importance sampling says that, when we generate a random element c05-math-0039 using pdf c05-math-0040, we define the (single-run) estimator

equation

As usual, we take the sample mean of c05-math-0042 independent retrials. Clearly, we obtain an unbiased estimator of the counting quantity, c05-math-0043. Furthermore, it is easy to see that the estimator has zero variance if and only if c05-math-0044, the uniform pdf on the target set.

Next, we assume additionally that the sample space c05-math-0045 is contained in some c05-math-0046-dimensional vector space; that is, samples c05-math-0047 can be represented by vectors of c05-math-0048 components. For instance, consider the problem of counting SAWs of length c05-math-0049. Each sample is a simple walk c05-math-0050 where the individual components c05-math-0051 are points in the integer two-dimensional lattice. Then we might consider to decompose the importance sampling pdf c05-math-0052 as a product of conditional pdfs:

5.1 c05-math-0053

The importance sampling simulation of generating a random sample c05-math-0054 is executed by generating sequentially the next component c05-math-0055 (c05-math-0056) given the previouscomponents c05-math-0057. This method is called sequential importance sampling (SIS); see Section 5.7 in [108] for details in a general setting.

In particular, we apply a specific version of SIS, the OSLA procedure due to Rosenbluth and Rosenbluth [97], which was originally introduced for SAWs, as we described in the introductory section. Below, we give more details of the consecutive steps of the OSLA procedure, where we have in mind generating a sample c05-math-0058 for problems in which c05-math-0059 represents a path of consecutive points c05-math-0060. The first point c05-math-0061 of the path is fixed and constant for all paths, called the origin. For example, in the SAW problem, c05-math-0062, or in a network with source c05-math-0063 and sink c05-math-0064, c05-math-0065.

Procedure 1. OSLA
1. Initial step. Start from the origin c05-math-0066. Set c05-math-0067.
2. Main step. Let c05-math-0068 be the number of neighbors of c05-math-0069 that have not yet been visited. If c05-math-0070, choose c05-math-0071 with probability c05-math-0072 from its neighbors. If c05-math-0073, stop generating the path and deliver an estimate c05-math-0074.
3. Stopping rule. Stop if c05-math-0075. Otherwise, increase c05-math-0076 by 1 and go to step 2.
4. The estimator. Return

5.2 c05-math-0077

Note that the OSLA procedure defines the SIS pdf:

5.3 c05-math-0078

The OSLA counting algorithm now follows.

Algorithm 5.1 OSLA Algorithm
1. Generate independently c05-math-0079 paths c05-math-0080 from SIS pdf c05-math-0081 via the above OSLA procedure.
2. For each path c05-math-0082, compute the corresponding c05-math-0083 as in (5.2). For the other parts (which do not reach the value c05-math-0084), set c05-math-0085.
3. Return the OSLA estimator:

5.4 c05-math-0086

The efficiency of the OSLA method deteriorates rapidly as c05-math-0087 becomes large. For example, it becomes impractical to simulate random SAWs of length more than 200. This is due to the fact that, if at any step c05-math-0088 the point c05-math-0089 does not have unoccupied neighbors (c05-math-0090), then c05-math-0091 is zero and it contributes nothing to the final estimate of c05-math-0092.

As an example, consider again Figure 5.2, depicting a SAW trapped after 15 iterations. One can easily see that the corresponding values c05-math-0093 of each of the 15 points are

equation

As for another situation where OSLA can be readily trapped, consider a directed graph in Figure 5.3 with source c05-math-0095 and sink c05-math-0096. There are two ways from c05-math-0097 to c05-math-0098, one via nodes c05-math-0099 and another via nodes c05-math-0100. Figure 5.3 corresponds to c05-math-0101. Note that all nodes besides c05-math-0102 and c05-math-0103 are directly connected to a central node c05-math-0104, which has no connection with c05-math-0105. Clearly, in this case, most of the random walks (with probability c05-math-0106) will be trapped at node c05-math-0107.

Figure 5.3 Directed graph.

c05f003

5.2.1 Extension of OSLA: c05-math-0108SLA Method

A natural extension of the OSLA procedure is to look ahead more than one step. We consider only the case of looking all the way to the end, which we call the c05-math-0109SLA method. This means that no path will be ever lost, and it implies that c05-math-0110, for all c05-math-0111.

Consider, for example, the SAW in Figure 5.2. If we could use the c05-math-0112SLA method instead of OSLA, we would rather move after step 13 (corresponding to point c05-math-0113) South instead of North. By doing so we would prevent the SAW being trapped after 15 iterations.

For many problems, including SAWs, the c05-math-0114SLA algorithm requires additional memory and computing power; for that reason, it has limited applications. There exists, however, a set of problems where c05-math-0115SLA can be implemented easily by using polynomial-time oracles. As mentioned, relevant examples are counting perfect matchings in a graph and counting the number of paths in a network.

The c05-math-0116SLA procedure does not differ much from the OSLA procedure. For completeness, we present it below.

Procedure 2. nSLA
1. Initial step. Same as in Procedure 1.
2. Main step. Employ an oracle and find c05-math-0117 the number of neighbors of c05-math-0118 that have not yet been visited and from which the path can be completed successfully. Choose c05-math-0119 with probability c05-math-0120 from its neighbors.
3. Stopping rule. Same as in Procedure 1.
4. The Estimator. Same as in Procedure 1.

To see how c05-math-0121SLA works in practice, consider a simple example following the main steps of the OSLA Algorithm 5.1.

Example 5.1
Let c05-math-0122 be the sample space consisting of the three-dimensional binary vectors, and suppose that c05-math-0123 is the target set of valid combinations (or paths). We have c05-math-0124 and c05-math-0125. Note that in the c05-math-0126SLA algorithm, it always holds that c05-math-0127, whereas c05-math-0128 may occur in the OSLA algorithm. Figure 5.4 presents a tree corresponding to the set c05-math-0129. In this toy example, there is no need to consider the origin c05-math-0130.
Figure 5.4 Tree corresponding to the set c05-math-0131.
c05f004
According to c05-math-0132SLA Procedure 2, we start with the first binary variable c05-math-0133. Because c05-math-0134, we employ the oracle two times; once for c05-math-0135 and once for c05-math-0136. That is, we ask the oracle whether there is a valid combination among all triplets c05-math-0137; also we ask this question concerning the triplets c05-math-0138. The role of the oracle is merely to provide a YES-NO answer for these questions. Clearly, in our case, the answer is YES in both cases, because an example of c05-math-0139 is, say, 000 and an example of c05-math-0140 is, say, 110. We therefore have c05-math-0141. Following Procedure 2, we next flip a symmetric coin. Assume that the outcome is 0. This means that we will proceed to path c05-math-0142.
Consider next c05-math-0143. Again, we employ the oracle two times; once for c05-math-0144 (by considering the triplet c05-math-0145) and once for c05-math-0146 (by considering the triplet c05-math-0147). In this case, the answer is YES for the case c05-math-0148 (an example of c05-math-0149 is, as before, 000) and NO for the case c05-math-0150 (there is no valid assignment in the set c05-math-0151 for c05-math-0152 with c05-math-0153). We therefore have c05-math-0154, and we proceed to path c05-math-0155.
We finally ask the oracle about c05-math-0156: do c05-math-0157 and c05-math-0158 yield feasible paths? In this case, the answer is YES for both cases, because we automatically obtain 000 and 001. We have c05-math-0159. The resulting estimator is therefore

equation

Figure 5.5 presents the subtrees c05-math-0161 (in bold) generated by c05-math-0162SLA using the oracle.

Figure 5.5 The subtrees c05-math-0163 (in bold) generated by c05-math-0164SLA using the oracle.
c05f005
Similarly to the analysis above for the trajectories 000 and 001, the valid trajectory 100 results in c05-math-0165, whereas the valid trajectories 110, 111 result in c05-math-0166. Because the corresponding probabilities for c05-math-0167 and c05-math-0168 are c05-math-0169 and c05-math-0170, we can compute the variance of c05-math-0171:

equation

As a comparison, the OSLA algorithm generates the valid combinations each with probability c05-math-0173 (with probability c05-math-0174 OSLA is trapped). Hence the associated OSLA estimator has variance 15.squ

The main drawback of c05-math-0175SLA Procedure 2 is that its SIS pdf c05-math-0176 is model dependent. Typically, it is far from the ideal uniform SIS pdf c05-math-0177, that is,

equation

As a result, the estimator of c05-math-0179 has a large variance.

To see the nonuniformity of c05-math-0181, consider a 2-SAT model with clauses c05-math-0182, where c05-math-0183 Figure 5.6 presents the corresponding graph with four literals and c05-math-0184. In this case, c05-math-0185, the zero variance pdf c05-math-0186, whereas the SIS pdf is

equation

which is highly nonuniform.

Figure 5.6 A graph with four literals and c05-math-0180.

c05f006

To improve the nonuniformity of c05-math-0188, we will run the c05-math-0189SLA procedure in parallel by multiple trajectories. Before doing so, we present below for convenience a multiple trajectory version of the OSLA Algorithm 5.1 for SAWs.

5.2.2 Extension of OSLA for SAW: Multiple Trajectories

In this section, we extend the OSLA method to multiple trajectories and present the corresponding algorithm. For ease of referencing, we call it multiple OSLA. We provide it here for counting SAWs.

5.2.2.1 Multiple-OSLA Algorithm for SAW

Recall that a SAW is a sequence of moves in a lattice such that it does not visit the same point more than once. There are specially designed counting algorithms, for instance, the pivot algorithm [30]. Empirically we found that these outperform our multiple-OSLA algorithm; nevertheless, we present it below in the interest of clarity of representation and for motivational purposes.

For simplicity, we assume that the walk starts at the origin, and we confine ourselves to the two-dimensional integer lattice case. Each SAW is represented by a path c05-math-0190, where c05-math-0191. A SAW of length c05-math-0192 has been given in Figure 5.1.

Algorithm 5.2. Multiple OSLA for SAW
1. Iteration 1
  • Full Enumeration. Select a small number c05-math-0193, say c05-math-0194 and count via full enumeration all different SAWs of size c05-math-0195 starting from the origin c05-math-0196. Denote the total number of these SAWs by c05-math-0197 and call them the elite sample. For example, for c05-math-0198, the number of elites c05-math-0199. Set the first level to c05-math-0200. Proceed with the c05-math-0201 elites from level c05-math-0202 to the next one, c05-math-0203, where c05-math-0204 is a small integer (typically c05-math-0205 or c05-math-0206) and count via full enumeration all different SAWs at level c05-math-0207. Denote the total number of such SAWs by c05-math-0208. For example, for c05-math-0209 there are c05-math-0210 different SAWs.
  • Calculation of the First Weight Factor. Compute

    5.5 c05-math-0211

    and call it the first weight factor.
2. Iteration c05-math-0212
  • Full Enumeration. Proceed with c05-math-0213 elites from iteration c05-math-0214 to the next level c05-math-0215 and derive via full enumeration all SAWs at level c05-math-0216, that is, of all those SAWs that continue the c05-math-0217 paths resulting from the previous iteration. Denote by c05-math-0218 the resulting number of such SAWs.
  • Stochastic Enumeration. Select randomly without replacement c05-math-0219 SAWs from the set of c05-math-0220 ones and call this step stochastic enumeration.
  • Calculation of the c05-math-0221-th Weight Factor. Compute

    5.6 c05-math-0222

    and call it the c05-math-0223-th weight factor. Similar to OSLA, the weight factor c05-math-0224 can be both c05-math-0225 and c05-math-0226; in casec05-math-0227, we stop and deliver c05-math-0228.
3. Stopping Rule
  • Proceed with iteration c05-math-0229 and compute

    5.7 c05-math-0230

  • Call c05-math-0231 the point estimator of c05-math-0232.
  • Since the number of levels is fixed, c05-math-0233 presents an unbiased estimator of c05-math-0234 (see [73]).
4. Final Estimator
  • Run Steps 1–3 for c05-math-0235 independent replications and deliver

    5.8 c05-math-0236

    as an unbiased estimator of c05-math-0237.
  • Call c05-math-0238 the multiple-OSLA estimator of c05-math-0239.

A few remarks can be made:

  • Typically, one keeps the number of elites c05-math-0240 in multiple OSLA fixed, say c05-math-0241, while c05-math-0242 varies from iteration to iteration.
  • OSLA represents a particular case of multiple OSLA, when the number of elites is c05-math-0243 in all iterations.
  • In contrast to OSLA, which loses most of its trajectories (even for modest c05-math-0244), with multiple OSLA we can reach quite large levels, say c05-math-0245, provided the number c05-math-0246 of elite samples is not too small, say c05-math-0247 in all iterations. Hence, one can generate very long random SAWs with multiple OSLA.
  • The sample variance of c05-math-0248 is

    5.9 c05-math-0249

    and the relative error is

    5.10 c05-math-0250

  • There is similarity with the splitting method of Chapter 4 in the sense that the whole state space is broken in smaller search spaces, in which the promising samples (elites) are chosen for prolongation.
Example 5.2
The first two iterations of Algorithm 5.2 for c05-math-0251, c05-math-0252, and c05-math-0253 are given below.
1. Iteration 1
  • Full Enumeration. We set c05-math-0254 and count (via full enumeration) all different SAWs of length c05-math-0255 starting from the origin c05-math-0256. We have c05-math-0257 (see Figure 5.7). We proceed (again via full enumeration) to derive from the c05-math-0258 elites all SAWs of length c05-math-0259 (there are c05-math-0260 of them, see part (a) of Figure 5.8).
  • Calculation of the first weight factor. We have c05-math-0261.
2. Iteration 2
  • Stochastic Enumeration. Select randomly without replacement c05-math-0262 elites from the set of c05-math-0263 ones (see part (b) of Figure 5.8).
  • Full Enumeration. Proceed via full enumeration to determine all SAWs of length c05-math-0264 that extend the c05-math-0265 elites. There are c05-math-0266 of them, see part (a) of Figure 5.9.
  • Calculation of the second weight factor. We have c05-math-0267.
Figure 5.7 The first four elites c05-math-0268.
c05f007
Figure 5.8 First iteration of Algorithm 5.2.
c05f008
Figure 5.9 Second iteration of Algorithm 5.2.
c05f009
Remark 5.1
Here we support empirically a previous remark that multiple OSLA can generate very long random SAWs. To do so, we ran the multiple OSLA algorithm for several fixed values of c05-math-0269 and c05-math-0270. Specifically, we considered the values c05-math-0271. For small elite sizes, the full enumeration numbers c05-math-0272 are also small (relatively), and easy to compute. For instance a run with c05-math-0273 resulted in a trajectory of length 30 with consecutive c05-math-0274-numbers
equation
For the c05-math-0276 values mentioned above, we executed the algorithm 20 times independently, each time until the algorithm got stuck. The observed 20 lengths of SAW trajectories were ordered and denoted by c05-math-0277 (c05-math-0278 for the smallest, c05-math-0279 for the largest length). Table 5.1 shows 5 of these 20 lengths (per c05-math-0280) and the average of all 20 lengths.
Table 5.1 Ordered lengths c05-math-0281 of simulated SAW's for c05-math-0282=1, 2, 5, 15, 25, 35
c05-tab-0001
The first c05-math-0290-column of Table 5.1 reflects simulation results for OSLA. The average length of the generated SAW trajectories is about 65. After many more experiments with OSLA, we found that only 1% of the generated trajectories reaches length 200.
We denote by c05-math-0291 the average length of the simulated trajectories using elite size c05-math-0292, as shown in the last row of the table for c05-math-0293. It is interesting to plot the regression line of c05-math-0294 based on the data c05-math-0295. We see that the average trajectory length increases linearly with elite size (Figure 5.10).
Figure 5.10 Regression of SAW trajectory lengths against elite size.
c05f010

Experiments with the multiple-OSLA algorithm for general counting problems, like SAT, indicated that this method is also susceptible to generating many zeros (trajectories of zero length); even for a relatively small model sizes. For this reason it has limited applications.

For example, consider a 3-SAT model with an adjacency matrix c05-math-0296 and c05-math-0297. Running the multiple-OSLA Algorithm 5.2 with c05-math-0298, we observed that it discovered all 15 valid assignments (satisfying all 80 clauses) only with probability c05-math-0299. We found that, as the size of the models increases, the percentage of valid assignments goes rapidly to zero.

5.3 SE Method

Here we present our main algorithm, called stochastic enumeration (SE), which extends both the c05-math-0300SLA and the multiple-OSLA algorithms as follows:

  • SE extends c05-math-0301SLA in the sense that it uses multiple trajectories instead of a single one.
  • SE extends the multiple-OSLA Algorithm 5.2 in the sense that it uses an oracle at the Full Enumeration step.

We present SE for the models where the components of the vector c05-math-0302 are assumed to be binary variables, such as SAT, and where fast decision-making c05-math-0303SLA oracles are available (see [35] [36] for SAT). Its modification to arbitrary discrete variables is straightforward.

5.3.1 SE Algorithm

Consider the multiple-OSLA Algorithm 5.2 and assume for simplicity that c05-math-0304 and that at iteration c05-math-0305 the number of elites is, say, c05-math-0306. In this case, it can be seen that, in order to implement an oracle in the Full Enumeration step at iteration c05-math-0307, we have to run it c05-math-0308 times: 100 times for c05-math-0309 and 100 more times for c05-math-0310. For each fixed combination of c05-math-0311, the oracle can be viewed as an c05-math-0312SLA algorithm in the following sense:

  • It sets first c05-math-0313 and then makes a decision (YES-NO path) for the remaining c05-math-0314 variables c05-math-0315.
  • It sets next c05-math-0316 and then again makes a similar (YES-NO) decision for the same set c05-math-0317.
Algorithm 5.3 SE Algorithm
1. Iteration 1
  • Full Enumeration. (Similar to Algorithm 5.2.) Let c05-math-0318 be the number corresponding to the first c05-math-0319 variables c05-math-0320. Count via full enumeration all different paths (valid assignments in SAT) of size c05-math-0321. Denote the total number of these paths (assignments) by c05-math-0322 and call them the elite sample. Proceed with the c05-math-0323 elites from level c05-math-0324 to the next one c05-math-0325, where c05-math-0326 is a small integer (typically c05-math-0327 or c05-math-0328) and count via full enumeration all different paths (assignments) of size c05-math-0329. Denote the total number of such paths (assignments) by c05-math-0330.
  • Calculation of the First Weight Factor. Same as in Algorithm 5.2.
2. Iteration c05-math-0331
  • Full Enumeration. (Same as in Algorithm 5.2, except that it is performed via the corresponding polynomial time oracle rather than OSLA.) Recall that for each fixed combination of c05-math-0332, the oracle can be viewed as an c05-math-0333-step look-ahead algorithm in the sense that it
    • Sets first c05-math-0334 and then makes a YES-NO decision for the path associated with the remaining c05-math-0335 variables c05-math-0336.
    • Sets next c05-math-0337 and then again makes a similar (YES-NO) decision.
  • Stochastic Enumeration. Same as in Algorithm 5.2.
  • Calculation of the c05-math-0338-th Weight Factor. (Same as in Algorithm 5.2.) Recall that, in contrast to multiple OSLA, where c05-math-0339, here c05-math-0340.
3. Stopping Rule. Same as in Algorithm 5.2.
4. Final Estimator. Same as in Algorithm 5.2.

It follows that, if c05-math-0341 in all iterations, the SE Algorithm 5.3 will be exact.

Remark 5.2
The SE method can be viewed as a multilevel splitting method with a specially chosen importance function [48]. In the traditional splitting method [12] and [13] [104], one chooses an obvious importance function, say the number of satisfied clauses in a SAT problem or the length of a walk in SAW. Here we simply decompose the rare event into non rare events by introducing intermediate levels. In the proposed method, we introduce a random walk on a graph, starting at some node on the graph, and we try to find an alternative (better) importance function that can be computed in polynomial time and that provides a reasonable estimate of the probability of the rare event. This is the same as saying that we are choosing a specific dynamics on the graph, and we are trying to optimize the importance function for this precise dynamics.
It is well known that the best possible importance function in a dynamical rare-event environment that is driven by a nonstationary Markov chain is the committor function [87]. It is also well known that its computation is at least as difficult as the underlying rare event. In the SE approach, however, we roughly approximate the committor function using an oracle in the sense that we can say whether this probability is zero or not. For example, in the SAT problem with already assigned literals, we can compute whether or not they can lead to a valid solution. The committor is equal to the probability c05-math-0342 of hitting the rare event as a function of the initial state c05-math-0343 of the Markov chain. In particular, for SAT, the committor being c05-math-0344 implies that we keep c05-math-0345, otherwise we take c05-math-0346; for SAW, we may also have c05-math-0347 on points for which the committor is c05-math-0348.

Figure 5.11 presents the dynamics of the SE Algorithm 5.3 for the first three iterations in a model with c05-math-0349 variables using c05-math-0350. There are three valid paths (corresponding to the dashed lines) reaching the final level c05-math-0351 (with the aid of an oracle), and one invalid path (indicated by the cross). It follows from Figure 5.11 that the accumulated weights are c05-math-0352.

Figure 5.11 Dynamics of the SE Algorithm 5.3 for the first three iterations.

c05f011

The SE estimator c05-math-0353 is unbiased for the same reason as its multiple-OSLA counterpart (5.7); namely, both can be viewed as multiple splitting methods with fixed (nonadaptive) levels [16].

Below we show how SE works for several toy examples.

Example 5.3
Consider the SAT model

equation

Suppose that c05-math-0355, c05-math-0356, c05-math-0357, and c05-math-0358.

1. Iteration 1
  • Full Enumeration. Since c05-math-0359, we handle first the variables c05-math-0360 and c05-math-0361. Using SAT solver we obtain three trajectories c05-math-0362, c05-math-0363, which can be extended to valid solutions. Trajectory c05-math-0364 cannot be extended to a valid solution and is discarded by the oracle. We have, therefore, c05-math-0365, which is still within the allowed budget c05-math-0366.
    We proceed to c05-math-0367 and, by using the oracle, we derive from the c05-math-0368 elites all SAT assignments of length c05-math-0369. By full enumeration we obtain the trajectories c05-math-0370. Trajectory c05-math-0371 cannot be extended to a valid solution and is discarded by the oracle. We have, therefore, c05-math-0372.
  • Calculation of the first weight factor. We have c05-math-0373.
2. Iteration 2
  • Stochastic Enumeration. Because c05-math-0374 we resort to sampling by selecting randomly without replacement c05-math-0375 trajectories from the set of c05-math-0376. Suppose we pick c05-math-0377. These will be our working trajectories in the next step.
  • Full Enumeration. We proceed with the oracle to handle c05-math-0378; that is, derive from the c05-math-0379 elites all valid SAT assignments of length c05-math-0380. By full enumeration we obtain the trajectories c05-math-0381 c05-math-0382. We have, therefore, again c05-math-0383.
  • Calculation of the second weight factor. We have c05-math-0384.

The SE estimator of the true c05-math-0385 based on the above two iterations is c05-math-0386. When we would take a larger number of elites in each iteration, say c05-math-0387, we would get the exact result: c05-math-0388.squ

Example 5.8 is the c05-math-0389 version of a special type of 2-SAT problems involving c05-math-0390 literals and c05-math-0391 clauses:

equation

For any initial number c05-math-0393 of literals in the first iteration, we have c05-math-0394 and c05-math-0395, where c05-math-0396 denotes the c05-math-0397-th Fibonacci number. In particular, if c05-math-0398, we have c05-math-0399 and c05-math-0400 different SAT assignments.

Example 5.4
Consider the SAT model

equation

Suppose again that c05-math-0402, c05-math-0403, c05-math-0404, and c05-math-0405.

1. Iteration 1 The same as in Example 5.8.
2. Iteration 2
  • Stochastic Enumeration. We select randomly without replacement c05-math-0406 elites from the set of c05-math-0407. Suppose we pick c05-math-0408c05-math-0408a.
  • Full Enumeration. We proceed with oracle to handle c05-math-0409, that is, derive from the c05-math-0410 elites all SAT assignments of length c05-math-0411. By full enumeration we obtain the trajectories c05-math-0412c05-math-0412a c05-math-0413. We have, therefore, c05-math-0414.
  • Calculation of the second weight factor. We have c05-math-0415.

The estimator of the true c05-math-0416 based on the above two iterations is c05-math-0417. It is readily seen that if we set again c05-math-0418 instead of c05-math-0419, we would get the exact result, that is, c05-math-0420.squ

One can see that as c05-math-0421 increases, the variance of the SE estimator c05-math-0422 in (5.7) decreases and for c05-math-0423 we have c05-math-0424.

Example 5.5 Example 5.1 Continued
Let again c05-math-0425 be a three dimensional vector with c05-math-0426c05-math-0426a being the set of its valid combinations. As before, we have c05-math-0427, c05-math-0428 and c05-math-0429. In contrast to Example 5.1, where c05-math-0430, we assume that c05-math-0431.
We have c05-math-0432 and c05-math-0433. Because c05-math-0434 we proceed with the following three pairs c05-math-0435. They result into c05-math-0436, respectively, with their corresponding pairs c05-math-0437, c05-math-0438, c05-math-0439.
It is readily seen that the estimator of c05-math-0440 based on c05-math-0441 and c05-math-0442 equals c05-math-0443, and the one based on c05-math-0444 is c05-math-0445. Noting that their probabilities are equal to c05-math-0446 and averaging over all three cases we obtain the desired results c05-math-0447. The variance of c05-math-0448 is
equation

It follows from the above that by increasing c05-math-0450 from 1 to 2, the variance decreases 21 times. Figure 5.12 presents the subtrees c05-math-0451 (in bold) of the original tree (based on the set c05-math-0452), generated using the oracle with c05-math-0453.squ

Figure 5.12 The subtrees c05-math-0454 (in bold) corresponding to c05-math-0455 in Example 5.5.
c05f012
Example 5.6
Consider a problem with five binary variables and solution set represented by Figure 5.13. Figures 5.14 and 5.15 present typical subtrees (in bold) generated by setting c05-math-0456, and c05-math-0457, respectively.squ
Figure 5.13 The problem tree of Example 5.5 having five variables.
c05f013
Figure 5.14 Subtree (in bold) corresponding to c05-math-0458 in Example 5.6.
c05f014
Figure 5.15 Subtree (in bold) corresponding to c05-math-0459 in Example 5.6.
c05f015

As mentioned earlier, the major advantage of SE Algorithm 5.3 versus its c05-math-0460SLA counterpart is that the uniformity of c05-math-0461 in the former increases in c05-math-0462. In other words, c05-math-0463 becomes “closer” to the ideal pdf c05-math-0464. We next demonstrate numerically this phenomenon while considering the following two simple models:

i. A 2-SAT model of c05-math-0465 literals with clauses c05-math-0466, where c05-math-0467. It is easy to check that c05-math-0468. See Figure 5.6 for c05-math-0469 literals and c05-math-0470. Straightforward calculation yields that, for this particular case, the variance reduction obtained by using c05-math-0471 instead of c05-math-0472, is about 150 times.Table 5.2 presents the efficiency of the SE Algorithm 5.3 for the model having c05-math-0473. We considered different values of c05-math-0474 and c05-math-0475. The comparison was done for
equation
The relative error RE was calculated as

equation

As expected for small c05-math-0488 (c05-math-0489, the relative error RE of the estimator c05-math-0490 is large and it underestimates c05-math-0491. Starting from c05-math-0492 the estimator stabilizes. Note that for c05-math-0493 the estimator is exact because c05-math-0494. Recall that the optimal zero variance SIS pdf over the c05-math-0495 paths

equation

is c05-math-0497.
ii. Counting the number of c05-math-0498 paths in a graph c05-math-0499 that has c05-math-0500 intermediate vertices, such that there is exactly one c05-math-0501 path of length c05-math-0502, for each c05-math-0503. Thus c05-math-0504. Figure 5.16 presents such a graph with c05-math-0505, and its associated tree of solutions. The results for the graph with c05-math-0506 paths were similar as in Table 5.2 for the 2-SAT example above.

Table 5.2 The Efficiencies of the SE Algorithm 5.3 for the 2-SAT Model with c05-math-0477

c05-math-0478 c05-math-0479 RE
c05-math-0480 11.110 0.296
c05-math-0481 38.962 0.215
c05-math-0482 69.854 0.175
c05-math-0483 102.75 0.079
c05-math-0484 101.11 0.032
c05-math-0485 100.45 0.012
c05-math-0486 100.00 0.000

Figure 5.16 A c05-math-0507 graph and its associated tree with c05-math-0508 paths.

c05f016

5.4 Applications of SE

Below we present several possible applications of SE. As usual we assume that there exists an associated polynomial time decision-making oracle.

5.4.1 Counting the Number of Trajectories in a Network

We show how to use SE for counting the number of trajectories (paths) in a network with a fixed source and sink. We demonstrate this for c05-math-0509. The modification to c05-math-0510 is straightforward. Consider the following two toy examples.

Example 5.7 Bridge Network
Consider the undirected graph in Figure 5.17. Suppose we wish to count the four trajectories

5.11 c05-math-0511

between the source node c05-math-0512 and sink node c05-math-0513.

1. Iteration 1 Starting from c05-math-0514 we have two nodes, c05-math-0515 and c05-math-0516, and the associated vector c05-math-0517. Because each c05-math-0518 is binary, we have the following four combination: c05-math-0519. Note that only the trajectories c05-math-0520 are relevant here because c05-math-0521can not be extended to node c05-math-0522, while the trajectory c05-math-0523 is redundant given c05-math-0524. We have thus c05-math-0525 and c05-math-0526.
2. Iteration 2 Assume that we selected randomly the path c05-math-0527 among the two, c05-math-0528 and c05-math-0529. By doing so we arrive at the node c05-math-0530 containing the edges c05-math-0531. According to SE only the edges c05-math-0532 and c05-math-0533 are relevant. As before, their possible combinations are c05-math-0534 Arguing similarly to Iteration 1 we have that c05-math-0535 and c05-math-0536. Consider separately the two possibilities associated with edges c05-math-0537 and c05-math-0538.(i) Edge c05-math-0539 is selected. In this case, we can go directly to the sink node c05-math-0540 and thus deliver an exact estimator c05-math-0541. The resulting path is c05-math-0542.
3. Iteration 3(ii) Edge c05-math-0543 is selected. In this case, we go to c05-math-0544 via the edge c05-math-0545. It is readily seen that c05-math-0546. We have again c05-math-0547. The resulting path is c05-math-0548.

Note that if we select the combination c05-math-0549 instead of c05-math-0550 we would get again c05-math-0551 and c05-math-0552, and thus again an exact estimator c05-math-0553.

Figure 5.17 Bridge network: count the number of paths from c05-math-0554 to c05-math-0555.
c05f017
If instead of (5.11) we would have a directed graph with the following three trajectories

5.12 c05-math-0556

then we obtain (with probability 1/2) an estimator c05-math-0557 for the path c05-math-0558 and (with probability 1/4) an estimator c05-math-0559 for the paths c05-math-0560 and c05-math-0561, respectively.squ

Example 5.8 Extended Bridge
Figure 5.18 presents an extended version of the bridge network in Figure 5.17.
Figure 5.18 Extended bridge network: number of paths from c05-math-0562 to c05-math-0563.
c05f018
We have the following seven trajectories:

5.13 c05-math-0564

1. Iteration 1 This iteration coincides with Iteration 1 of Example 5.14. We have c05-math-0565 and c05-math-0566.
2. Iteration 2 Assume that we selected randomly the combination (01) from the two, (01) and (10). By doing so we arrive at node c05-math-0567 containing the edges c05-math-0568. According to SE only c05-math-0569 are relevant. Of the seven combinations, only c05-math-0570 are relevant; there is no path through (000), and the remaining ones are redundant because they result in the same trajectories as the above three. Thus, we have c05-math-0571 and c05-math-0572. Consider separately the three possibilities associated with edges c05-math-0573 and c05-math-0574.(i) Edge c05-math-0575 is selected. In this case, we can go directly to the sink node c05-math-0576 and thus deliver c05-math-0577. The resulting path is c05-math-0578. Note that if we select either c05-math-0579 or c05-math-0580, there is no direct access to the sink c05-math-0581.
3. Iteration 3(ii) Edge c05-math-0582 is selected. In this case we go to c05-math-0583 via the edge c05-math-0584. It is readily seen that c05-math-0585. We have again c05-math-0586. The resulting path is c05-math-0587.(iii) Edge c05-math-0588 is selected. By doing so we arrive at node c05-math-0589 (the intersection of c05-math-0590). The only relevant edge is c05-math-0591 We have c05-math-0592.
4. Iteration 4 We proceed with the path c05-math-0593, which arrived to point c05-math-0594, the intersection of c05-math-0595. The only relevant edge among c05-math-0596 is c05-math-0597 We have c05-math-0598 and c05-math-0599. The resulting path is c05-math-0600.
Figure 5.19 presents the subtree corresponding to the path c05-math-0601 for the extended bridge in Figure 5.18.
Figure 5.19 Subtree consisting of the path c05-math-0602.
c05f019
It can be seen that if we choose the combination c05-math-0603 instead of c05-math-0604 we obtain c05-math-0605 for all four remaining cases. Below we summarize all seven cases.
Path Probability Estimator
c05-math-0606 c05-math-0607 8
c05-math-0608 c05-math-0609 8
c05-math-0610 c05-math-0611 8
c05-math-0612 c05-math-0613 8
c05-math-0614 c05-math-0615 6
c05-math-0616 c05-math-0617 6
c05-math-0618 c05-math-0619 6

Averaging over the all cases we obtain c05-math-0620 and thus, the exact value.squ

Consider now the case c05-math-0621. In particular, consider the graph in Figure 5.18 and assume that c05-math-0622. In this case, at iteration 1 of SE Algorithm 5.3 both edges c05-math-0623 and c05-math-0624 will be selected. At iteration 2 we have to choose randomly two nodes out of the four: c05-math-0625, c05-math-0626, c05-math-0627, c05-math-0628.Assume that c05-math-0629 and c05-math-0630 are selected. Note that by selecting c05-math-0631, we completed an entire path, c05-math-0632. Note, however, that the second path that goes through the edges c05-math-0633, c05-math-0634 will be not yet completed, since finally it can be either c05-math-0635 or c05-math-0636. In both cases, the shorter path c05-math-0637 must be synchronized (length-wise) with the longer ones c05-math-0638 or c05-math-0639 in the sense that, depending on whether c05-math-0640 or c05-math-0641 is selected, we have to insert into c05-math-0642 either one auxiliary edge from c05-math-0643 to c05-math-0644 (denoted c05-math-0645) or two auxiliary ones from c05-math-0646 to c05-math-0647 (denoted by c05-math-0648 and c05-math-0649). The resulting path (with auxiliary edges) will be either c05-math-0650 or c05-math-0651.

It follows from above that while adopting Algorithm 5.3 with c05-math-0652 for counting the number of paths in a general network, one will have to synchronize on-line all its paths with the longest one by adding some auxiliary edges until all paths will match length-wise with the longest one.

5.4.2 SE for Probabilities Estimation

Algorithm 5.3 can be modified easily for the estimation of different probabilities in a network, such as the probability that the length c05-math-0653 of a randomly chosen path c05-math-0654 is greater than a fixed number c05-math-0655, that is,

equation

Assume first that the length of each edge equals unity. Then the length c05-math-0657 of a particular path c05-math-0658 equals the number of edges from c05-math-0659 to c05-math-0660 on that path. The corresponding number of iterations is c05-math-0661 and the corresponding probability is

equation

Clearly, there is no need to calculate the weights c05-math-0663 and the length c05-math-0664 of each path c05-math-0665.

In cases where the lengths of the edges are different from one, c05-math-0666 represents the sum of the lengths of edges associated with that path c05-math-0667.

Algorithm 5.4 SE for Estimation of Probabilities
1. Iteration 1
  • Full Enumeration. Same as in Algorithm 5.3.
  • Calculation of the First Weight Factor. Redundant. Instead, store the lengths of the corresponding edges c05-math-0668.
2. Iteration c05-math-0669
  • Full Enumeration. Same as in Algorithm 5.3.
  • Stochastic Enumeration. Same as in Algorithm 5.3.
  • Calculation of the c05-math-0670-th Weight Factor. Redundant. Instead, store the lengths of the corresponding edges c05-math-0671.
3. Stopping Rule
  • Proceed with iteration c05-math-0672 and compute

    5.14 c05-math-0673

    where, as before, c05-math-0674 is the length of path c05-math-0675 representing the sum of the lengths of the edges associated with c05-math-0676.
4. Final Estimator
  • Run Algorithm 5.4 for c05-math-0677 independent replications and deliver

5.15 c05-math-0678

as an unbiased estimator of c05-math-0679.

We performed various numerical studies with Algorithm 5.4 and found that it performs properly, provided that c05-math-0680 is chosen such that c05-math-0681 is not a rare-event probability; otherwise, one needs to use the importance sample method. For example, for a random Erdös-Rényi graph with 15 nodes and 50 edges (see Remark 5.3 below) we obtained via full enumeration that the number of valid paths is 643,085. Furthermore, the probability c05-math-0682 that the length c05-math-0683 of a randomly chosen path c05-math-0684 is greater than c05-math-0685 equals c05-math-0686. From our numerical results with c05-math-0687 and c05-math-0688 based on 10 runs we obtained with Algorithm 5.4 an estimate c05-math-0689 with relative error about 1%.

Remark 5.3 Erdös-Rényi Random Graphs Generation
Random graphs generation is associated with Paul Erdös and Alfred Rényi. We consider indirected graphs generated according to what is called the c05-math-0690 Erdös-Rényi random model [44].
In the c05-math-0691 graph (c05-math-0692 is fixed), the graph is constructed by connecting nodes randomly. Each edge is included in the graph with probability c05-math-0693 independent from every other edge. Equivalently, all graphs with c05-math-0694 nodes and c05-math-0695 edges have the same probability
equation

A simple way to generate a random graph in c05-math-0697 is to consider each of the possible c05-math-0698 edges in some order and then independently add each edge to the graph with probability c05-math-0699. Note that the expected number of edges in c05-math-0700 is c05-math-0701, and each vertex has expected degree c05-math-0702. Clearly as c05-math-0703 increases from 0 to 1, the model becomes more dense in the sense that is it is more likely that it will include graphs with more edges than less edges.

5.4.3 Counting the Number of Perfect Matchings in a Graph

Here we deal with application of SE to compute the number of matchings in a graph with particular emphasis on the number of perfect matchings in a balanced bipartite graph.

Recall that a graph c05-math-0704 is bipartite if it has no circuits of odd length. It has the following property: the set of vertices c05-math-0705 can be partitioned in two disjoint sets, c05-math-0706 and c05-math-0707, such that each edge in c05-math-0708 has one vertex in c05-math-0709 and one in c05-math-0710. Thus, we denote a bipartite graph by c05-math-0711. In a balanced bipartite graph, the two subsets have the same cardinality: c05-math-0712. A matching of a graph c05-math-0713 is a subset of the edges with the property that no two edges share the same node. In other words, a matching is a collection of edges c05-math-0714 such that each vertex occurs at most once in c05-math-0715. A perfect matching is a matching that matches all vertices. Thus, a perfect matching in a balanced bipartite graph has size c05-math-0716.

Let c05-math-0717 be a balanced bipartite graph. Its associated biadjacency matrix c05-math-0718 is an c05-math-0719 binary matrix c05-math-0720 defined by

equation

It is well known [90] that the number of perfect matchings in a balanced bipartite graph coincides with the permanent of its associated biadjacency matrix c05-math-0722. The permanent of a binary c05-math-0723 matrix c05-math-0724 is defined as

5.16 c05-math-0725

where c05-math-0726 is the set of all permutations c05-math-0727 of c05-math-0728.

Example 5.9
Consider the bipartite graph shown in Figure 5.20. It has the following three perfect matchings:

5.17 c05-math-0729

Its associated biadjacency matrix is

5.18 c05-math-0730

The permanent of c05-math-0731 is

equation

We will show how SE works for c05-math-0733. Its extension to c05-math-0734 is simple. We say that an edge is active if the outcome of the corresponding variable is 1 and passive otherwise.

a. Iteration 1 Let us start from node c05-math-0735. Its degree is 2, and the corresponding edges are c05-math-0736 and c05-math-0737. To each of these edges we associate a c05-math-0738 random variable. An outcome of 1 (or 0) means that the associated edge is active (or passive). We let these two Bernoulli variables be independent. Thus, the possible outcomes are (00), (01), (10), (11). For instance, (10) means that edge c05-math-0739 is active and c05-math-0740 is passive, while (01) means it is the other way around. However, only (01) and(10) are relevant in as much as neither c05-math-0741 nor c05-math-0742 define a perfect matching. Employing the oracle, we obtain that each of the combinations (01) and (10) is valid, and starting from c05-math-0743 and c05-math-0744, we generate two different perfect matchings (see (5.17)); we therefore have that c05-math-0745.

We next proceed separately with the outcomes c05-math-0746 and c05-math-0747.

  • Outcome (10)
    a. Iteration 2 Recall that the outcome c05-math-0748 means that c05-math-0749 is active. This automatically implies that all three neighboring edges, c05-math-0750, c05-math-0751, c05-math-0752, must be passive. Using the perfect matching oracle we will arrive at the next active edge, which is c05-math-0753. Because the degree of node c05-math-0754 is two and since c05-math-0755 must be passive, we have that c05-math-0756.
    b. Iteration 3 Because c05-math-0757 is active, c05-math-0758 must be passive. The degree of node c05-math-0759 is three, but since c05-math-0760 and c05-math-0761 are passive, c05-math-0762 must be the only available active edge. This implies that c05-math-0763. The resulting estimator of c05-math-0764 is c05-math-0765
  • Outcome (01)
    a. Iteration 2 Because (01) means that c05-math-0766 is active, we automatically set the neighboring edges c05-math-0767, c05-math-0768 as passive. Using an oracle we shall arrive at node c05-math-0769, which has degree three. As c05-math-0770 is passive, it is easily seen that each edge, c05-math-0771 and c05-math-0772, will become active with probability 1/2. This means that with c05-math-0773 and c05-math-0774 we are in a similar situation (in the sense of active-passive edges) to that of c05-math-0775, and c05-math-0776. We thus have for each case c05-math-0777.
    b. Iteration 3 It is readily seen that both cases c05-math-0778, and c05-math-0779 lead to c05-math-0780. The resulting estimator of c05-math-0781 is c05-math-0782. Because each initial edge c05-math-0783 and c05-math-0784 at Iteration 1 is chosen with probability 1/2, by averaging over both cases we obtain the exact result, that is, c05-math-0785.
Figure 5.20 The bipartite graph.
c05f020
It is not difficult to see that when we select c05-math-0786 instead of c05-math-0787 we obtain c05-math-0788, that is, the exact value c05-math-0789.
Another view is to consider the equivalence with the permanent. The sample space might be defined to be all permutations c05-math-0790, where c05-math-0791 represents using edge c05-math-0792 in the matching. The solution set consists of the three permutations representing (5.17):

equation

The optimal zero variance importance sampling pdf is uniform on c05-math-0794 :

equation

The SE procedure above with c05-math-0796 leads to an importance sampling pdf c05-math-0797 satisfying

equation

The associated SE estimator satisfies

equation

yielding c05-math-0800, and c05-math-0801.squ

5.4.4 Counting SAT

Note that, although for general SAT the decision-making is an NP-hard problem, there are several very fast heuristics for this purpose. The most popular one is the famous DPLL solver [35] (see Remark 5.19 below), on which two main heuristic algorithms are based for approximately counting with emphasis on SAT. The first, called ApproxCount and introduced by Wei and Selman in [126], is a local search method that uses Markov chain Monte Carlo sampling to approximate the true counting quantity. It is fast and has been shown to yield good estimates for feasible solution counts, but there are no guarantees as to uniformity of the Markov chain Monte Carlo samples. Gogate and Dechter [56] [57] recently proposed an alternative counting technique called SampleMinisat, based on sampling from the so-called backtrack-free search space of a Boolean formula through SampleSearch. An approximation of the search tree thus found is used as the importance sampling density instead of a uniform distribution over all solutions. They also derived a lower bound for the unknown counting quantity. Their empirical studies demonstrate the superiority of their method over its competitors.

Remark 5.4 DPLL Algorithm
The Davis-Putman-Logemann-Loveland (DPLL) algorithm [35] is a complete, backtracking-based algorithm for deciding the satisfiability of propositional logic formulae in conjunctive normal form, that is for solving the CNF-SAT problem. DPLL is a highly efficient procedure and after more than 40 years still forms the basis for most efficient complete SAT solvers, as well as for many theorem provers for fragments of first-order logic.
The basic backtracking algorithm runs by choosing a literal, assigning a truth value to it, simplifying the formula, and then recursively checking whether the simplified formula is satisfiable. If this is the case, the original formula is satisfiable; otherwise, the same recursive check is done assuming the opposite truth value. This is known as the splitting rule, as it splits the problem into two simpler subproblems. The simplification step essentially removes all clauses that become true under the assignment from the formula and all literals that become false from the remaining clauses.

5.5 Numerical Results

Here we present numerical results with the multiple-OSLA and SE algorithms. In particular, we use the multiple-OSLA Algorithm 5.2 for counting SAWs. The reason for doing so is that we are not aware of any polynomial decision-making algorithm (oracle) for SAWs. For the remaining problems we use the SE Algorithm 5.3 because polynomial decision-making algorithms (oracles) are available for them. If not stated otherwise, we use c05-math-0802.

To achieve high efficiency of the SE Algorithm 5.3, we set c05-math-0803 as suggested in Section 5.3. In particular,

1. For SAT models to set c05-math-0804. Note that by doing so, c05-math-0805, where c05-math-0806 is the allowed budget. Also, in this case c05-math-0807 is the only parameter of SE. For the instances where we occasionally obtained (after simulation) an exact c05-math-0808, that is where c05-math-0809 is relatively small and where we originally set c05-math-0810, we purposely reset c05-math-0811 (to be fair to the other methods) by choosing a new c05-math-0812, satisfying c05-math-0813 and run SE again. By doing so we prevent SE from being an ideal (zero variance) estimator.
2. For other counting problems, such as counting the number of perfect matchings (permanent) and the number of paths in a network, to perform small pilot runes with several values of c05-math-0814 and select the best one.

We use the following notations:

1. c05-math-0815 denotes the number of elites at iteration c05-math-0816.
2. c05-math-0817 denotes the level reached at iteration c05-math-0818.
3. c05-math-0819 denotes the weight factor at iteration c05-math-0820.

5.5.1 Counting SAW

Tables 5.3 and 5.4 present the performance of the multiple-OSLA Algorithm 5.2 for SAW for c05-math-0821 and c05-math-0822, respectively, with c05-math-0823, c05-math-0824, and c05-math-0825 (see (5.8)). This corresponds to the initial values c05-math-0826 and c05-math-0827 (see also iteration c05-math-0828 in Table 5.5). Based on the runs in Table 5.3, we found c05-math-0829. Based on the runs in Table 5.4, we found c05-math-0830. Table 5.5 presents dynamics of one of the runs of the multiple-OSLA Algorithm 5.2 for c05-math-0831.

Table 5.3 Performance of the multiple-OSLA Algorithm 5.2 for counting SAW for c05-math-0837

c05-tab-0003

Table 5.4 Performance of the multiple-OSLA Algorithm 5.2 for counting SAW for c05-math-0839

c05-tab-0004

Table 5.5 Dynamics of a run of the multiple-OSLA Algorithm 5.2 for counting SAW for c05-math-0841

c05-tab-0005

5.5.2 Counting the Number of Trajectories in a Network

5.5.2.1 Model 1: From Roberts and Kroese [96] with c05-math-0832 Nodes

Table 5.6 presents the performance of the SE Algorithm 5.3 for Model 1 taken from Roberts and Kroese [96] with the following adjacency c05-math-0833 matrix:

equation

We set c05-math-0835 and c05-math-0836 to get a comparable running time.

Table 5.6 Performance of SE Algorithm 5.3 for counting trajectories in Model 1 Graph with c05-math-0848 and c05-math-0849

c05-tab-0006

Based on the runs in Table 5.6, we found c05-math-0851. Comparing the results of Table 5.6 with those in [96], it follows that the former is about 1.5 times faster than the latter.

5.5.2.2 Model 2: Large Model (c05-math-0852 vertices and c05-math-0853 edges)

Table 5.7 presents the performance of SE Algorithm 5.3 for Model 2 with c05-math-0854 and c05-math-0855. We found for this model c05-math-0856.

Table 5.7 Performance of SE Algorithm 5.3 for counting trajectories in Model 2 with c05-math-0857 and c05-math-0858

c05-tab-0007

We also counted the number of paths for Erdös-Rényi random graphs with c05-math-0860 (see Remark 5.3). We found that SE performs reliably (RE c05-math-0861) for c05-math-0862, provided the CPU time is limited to 5–15 minutes.

Table 5.8 presents the performance of SE Algorithm 5.3 for the Erdös-Rényi random graph with c05-math-0867 using c05-math-0868 and c05-math-0869. We found c05-math-0870.

Table 5.8 Performance of SE Algorithm 5.3 for counting trajectories in the Erdös-Rényi random graph c05-math-0863 with c05-math-0864 and c05-math-0865

c05-tab-0008
Remark 5.5
The SE method has some limitations, in particular when dealing with nonsparse instances. In this case, one must use in SE the full enumeration step (employ the oracle) many times. As a result, the CPU time of SE might increase dramatically. Consider, for example, the extreme case, a complete graph c05-math-0871. The exact number of c05-math-0872-c05-math-0873 paths between any two vertices is given by
equation

Table 5.9 presents the performance of SE Algorithm 5.3 for c05-math-0875 with c05-math-0876 and c05-math-0877. The exact solution is 7.0273E+022. For this model we found c05-math-0878, so the results are still good. However, as c05-math-0879 increases, the CPU time grows rapidly. For example, for c05-math-0880 we found that using c05-math-0881 and c05-math-0882 the CPU time is about 5.1 hours.

Table 5.9 Performance of SE Algorithm 5.3 for counting trajectories in c05-math-0883 with c05-math-0884 and c05-math-0885
c05-tab-0009

5.5.3 Counting the Number of Perfect Matchings in a Graph

We present here numerical results for three models, one small and two large.

5.5.3.1 Model 1: (Small Model)

Consider the following c05-math-0887 matrix where the true number of perfect matchings (permanent) is c05-math-0888, obtained using full enumeration:

equation

Table 5.10 presents the performance of SE Algorithm 5.3 for (c05-math-0890 and c05-math-0891). We found that the relative error is c05-math-0892.

Table 5.10 Performance of SE Algorithm 5.3 for counting perfect matchings in Model c05-math-0893 with c05-math-0894 and c05-math-0895

c05-tab-0010

Applying the splitting algorithm for the same model using c05-math-0897 and c05-math-0898, we found that the relative error is 0.2711. It follows that SE is about 100 times faster than splitting.

5.5.3.2 Model 2 with c05-math-0899 (Large Model)

Table 5.11 presents the performance of SE Algorithm 5.3 for Model 2 matrix c05-math-0900 and c05-math-0901. The relative error is 0.0434.

Table 5.11 Performance of SE Algorithm 5.3 for counting perfect matchings in Model 2 with c05-math-0902 and c05-math-0903

c05-tab-0011

5.5.3.3 Model 3: Erdös-Rényi Graph with c05-math-0905 Edges and c05-math-0906

Table 5.12 presents the performance of SE Algorithm 5.3 for the Erdös-Rényi graph with c05-math-0907 edges and c05-math-0908. We set c05-math-0909 and c05-math-0910. We found that the relative error is 0.0387.

Table 5.12 Performance of SE Algorithm 5.3 for counting perfect matchings in the Erdös-Rényi random graph using c05-math-0911 and c05-math-0912

c05-tab-0012

We also applied the SE algorithm for counting general matchings in a bipartite graph. The quality of the results was similar to that for paths counting in a network.

5.5.4 Counting SAT

Here, we present numerical results for several SAT models. We set c05-math-0914 in the SE algorithm for all models. Recall that for 2-SAT we can use a polynomial decision-making oracle [35], whereas for c05-math-0915-SAT c05-math-0916 heuristic based on the DPLL solver [35] [36] is used. Note that SE Algorithm 5.3 remains exactly the same when a polynomial decision-making oracle is replaced by a heuristic one, such as the DPLL solver. Running both SAT models we found that the CPU time for 2-SAT is about 1.3 times faster than for c05-math-0917-SAT c05-math-0918.

Table 5.13 presents the performance of SE Algorithm 5.3 for the 3-SAT c05-math-0919 model with exactly c05-math-0920 solutions. We set c05-math-0921 and c05-math-0922. Based on those runs, we found c05-math-0923.

Table 5.13 Performance of SE Algorithm 5.3 for the 3-SAT c05-math-0924 model

c05-tab-0013

Table 5.14 presents the performance of SE Algorithm 5.3 for the 3-SAT c05-math-0926 model. We set c05-math-0927 and c05-math-0928. The exact solution for this instance is c05-math-0929 and is obtained via full enumeration using the backward method. It is interesting to note that, for this instance (with relatively small c05-math-0930), the CPU time of the exact backward method is 332 seconds (compared with an average 16.8 seconds time of SE in Table 5.14). Based on those runs, we found that c05-math-0931.

Table 5.14 Performance of SE Algorithm 5.3 for the 3-SAT c05-math-0932 model

c05-tab-0014

Table 5.15 presents the performance of SE Algorithm 5.3 for the 3-SAT c05-math-0934 model. We set c05-math-0935 and c05-math-0936. Based on those runs, we found c05-math-0937.

Table 5.15 Performance of SE Algorithm 5.3 for the 3-SAT c05-math-0938 model with c05-math-0939, c05-math-0940 and c05-math-0941

c05-tab-0015

Note that, in this case, the estimator of c05-math-0943 is very large and, thus, full enumeration is impossible. We made, however, the exact solution c05-math-0944 available as well. It is c05-math-0945 3.297E+24 and is obtained using a specially designed procedure (see Remark 5.6, below) for SAT instances generation. In particular, the instance matrix c05-math-0946 was generated from the previous one c05-math-0947, for which c05-math-0948.

Remark 5.6 Generating an Instance with an Available Solution
We shall show that, given a small SAT instance with a known solution c05-math-0949, we can generate an associated instance of a large size and still obtain its exact solution. Suppose without loss of generality that we have c05-math-0950 instances (of relatively small sizes) with known c05-math-0951. Denote those instances by c05-math-0952, their dimensionality by c05-math-0953 and their corresponding solutions by c05-math-0954. We will show how to construct a new SAT instance that will have a size c05-math-0955 and its exact solution will be equal to c05-math-0956. The idea is very simple. Indeed, denote the variables of c05-math-0957 by c05-math-0958. Now, take the second instance and rename its variables from c05-math-0959 to c05-math-0960; that is to each variable index of c05-math-0961 we add c05-math-0962 new variables. Continue in the same manner with the rest of the instances. It should be clear that we have now an instance of size c05-math-0963.
Let us look next at some particular solution
equation

of this instance. This solution consists of independent components of sizes c05-math-0965, and it is straightforward to see that the total number of those solutions is c05-math-0966. It follows, therefore, that one can easily construct a large SAT instance from a set of small ones and still have an exact solution for it. Note that the above c05-math-0967 instance with exactly c05-math-0968 solutions was obtained from the four identical instances of size c05-math-0969, each with exactly 1,346,963 solutions.

We also performed experiments with different values of c05-math-0970. Table 5.16 summarizes the results. In particular, it presents the relative error for c05-math-0971, and c05-math-0972 with SE run for a predefined time period foreach instance. We can see that changing c05-math-0973 does not affect the relative error.

Table 5.16 The relative errors as functions of c05-math-0974

c05-tab-0016

5.5.5 Comparison of SE with Splitting and SampleSearch

Here we compare SE with splitting and SampleSearch for several 3-SAT instances. Before doing so we require the following remarks.

Remark 5.7 SE versus Splitting
1. In the splitting method of Chapter 4, the rare event c05-math-0987 is presented as

5.19 c05-math-0988

where c05-math-0989 has a uniform distribution on a finite c05-math-0990-dimensional set c05-math-0991, and c05-math-0992 is the number of clauses c05-math-0993. To estimate c05-math-0994 the splitting algorithm generates an adaptive sequence of pairs

5.20 c05-math-0995

where c05-math-0996 is uniformly distributed on the set c05-math-0997 and such that c05-math-0998.
2. In contrast to splitting, which samples from a sequence of c05-math-0999-dimensional pdf's c05-math-1000 (see (5.20)), sampling in SE Algorithm 5.3 is minimal; it resorts to sampling only c05-math-1001 times. In particular, SE draws c05-math-1002 balls (without replacing) from an urn containing c05-math-1003 ones.
3. Splitting relies on the time-consuming MCMC method and in particular on the Gibbs sampler, whereas SE dispenses with them and is thus substantially simpler and faster. For more details on splitting, see Chapter 4.
4. The limitation of SE relative to splitting is that the former is suitable for counting, where only fast (polynomial) decision-making oracles are available, whereas splitting dispenses with them. In addition, it is not suitable for optimization and rare events, as splitting is.
Remark 5.8 SE versus SampleSearch
The main difference between SampleSearch [56] [57] and SE is that the former approximates an entire #P-complete counting problem like SAT by incorporating IS in the oracle. As a result, it is only asymptotically unbiased. Wei and Selman's [126] ApproxCount is similar to SampleSearch in that it uses an MCMC sampler instead of IS. In contrast to both of the above, SE reduces the difficult counting problem to a set of simple ones, applying the oracle each time directly (via the Full Enumeration step) to the elite trajectories of size c05-math-1004. Note also that, unlike both of the above, there is no randomness involved in SE as far as the oracle is concerned in the sense that, once the elite trajectories are given, the oracle generates (via Full Enumeration) a deterministic sequence of new trajectories of size c05-math-1005. As a result, SE is unbiased for any c05-math-1006 and is typically more accurate than SampleSearch. Our numerical results below confirm this.

Table 5.17 presents a comparison of the efficiencies of SE (at c05-math-1007) with those of SampleSearch and splitting (SaS and Split columns, respectively) for several SAT instances. We ran all three methods for the same amount of time.

Table 5.17 Comparison of the efficiencies of SE, SampleSearch and standard splitting

c05-tab-0017

In terms of speed (which equals (RE)c05-math-1012), SE is faster than SampleSearch by about 2–10 times and standard splitting in [104] by about 20–50 times. Similar comparison results were obtained for other models, including perfect matching. Our explanation is that SE is an SIS method, whereas SampleSearch and splitting are not, in the sense that SE samples sequentially with respect to coordinates c05-math-1013, whereas the other two sample (random vectors c05-math-1014 from the IS pdf c05-math-1015) in the entire c05-math-1016-dimensional space.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.52.188