Proceedings of the Ninth Symposium on Abstraction, Reformulation and Approximation Efficient Pseudo-Boolean Satisfiability Encodings for Routing and Wavelength Assignment in Optical Networks Miroslav N. Velev Ping Gao Aries Design Automation Chicago, IL, U.S.A. miroslav.velev@aries-da.com by translation to SAT poses the research question of how best to exploit the structure of the original problem when translating it to an equivalent Boolean formula in order to achieve maximum speedup of the SAT solving. In this paper, we answer the above question for combined Routing and Wavelength Assignment (RWA) in optical networks (Ramaswami and Sivarajan 2001). We extend a previous approach for representing routing instances in optical networks as equivalent PseudoBoolean (PB-SAT) problems, proposed by Aloul et al. (2007b, 2008), in a way that exponentially reduces the size of the solution space, making it independent of the number of wavelengths per link, and results in speedups of up to 8 orders of magnitude. An advantage of a PBSAT based approach for network routing is that it is complete and guaranteed to find a solution if one exists, given sufficient run time and memory. Furthermore, it can easily account for constraints to avoid or include specific nodes or edges in the network, as well as other conditions for the route, such as unavailability of wavelengths on each edge, etc. Internet routing is dominated by link-state routing protocols, such as OSPF (Huitema 1999). In this protocol, routers exchange link-state information with neighboring routers, and then recompute the shortest paths between pairs of nodes by using shortest path algorithms, such as Dijkstra’s (1959). This algorithm is one of the earliest and most widely used methods for internet routing. However, besides minimizing a characteristic of the source-destination path, additional constraints could be imposed for a route (Aloul et al. 2007b, 2008) with an objective of: (1) optimizing the use of link bandwidth; (2) distributing the traffic across the entire network; (3) minimizing the number of hops; (4) avoiding specific nodes or combinations of nodes; and (5) redirecting existing traffic to satisfy the above criteria. It has been shown that when the routing problem is generalized to include many additional constraints, it becomes NP-complete (Subranmanian and Muthukumar 2003). The contributions of this paper are: 1) a novel representation of routing instances in optical networks as equivalent PB-SAT problems by introducing edge observability variables to indicate whether an edge is on Abstract We propose a novel method for combined Routing and Wavelength Assignment (RWA) in optical networks by reformulation to an equivalent Pseudo-Boolean Satisfiability (PB-SAT) problem. We introduce edge observability variables to represent whether an edge is on the optimal route, combined with either a simple or a hierarchical SAT encoding to select a wavelength for that edge only when the edge is on the route. This translation exponentially reduces the size of the solution space, making it independent of the number of wavelengths per link. We present experimental results for routing instances with up to 3,000 nodes, 15,000 edges, and 2,048 wavelengths per edge, and achieve at least 8 orders of magnitude speedup relative to a previous PB-SAT encoding by Aloul et al., such that the speedup is increasing with the number of nodes and edges in the network, and the number of wavelengths per edge. A portfolio of 4 parallel strategies, each based on the new approach and a different hierarchical encoding, resulted in additional speedup of up to 6 times, and reduced the variability of the run times for large networks. Introduction In the last decade, dramatic improvements were achieved in both the speed and capacity of Boolean Satisfiability (SAT) solvers, which are now up to 5 orders of magnitude faster and can handle problems that are up to 4 – 5 orders of magnitude bigger—e.g., see the results from the recent SAT-Solver Competitions1. The new efficient SAT solvers open new possibilities for applying this technology. By translating hard Computer Science problems to equivalent SAT problems, we can directly benefit from the recent tremendous advances in SAT, and the constant stream of innovations in this extremely active research field, without having to reimplement the same optimizations in specialized tools for specific problems. That approaches based on efficient translation to SAT can be competitive was demonstrated in the recent International Planning Competitions2, where first places in the optimal planning category were won by SAT-based planners (Kautz et al.; Xing et al. 2006). However, a solution approach 1. http://www.satcompetition.org 2. http://zeus.ing.unibs.it/ipc-5 Copyright 2011, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. 117 Boolean variable xvi is introduced for each CSP variable v and each domain value i of v, in order to encode whether v is assigned the value i. For each CSP variable, the introduced Boolean variables are constrained with an at-leastone clause (the disjunction of these variables) to ensure that the CSP variable is assigned at least one value, and at-mostone clauses that consist of all pairs of negated literals of these Boolean variables, thus guaranteeing that only one of these Boolean variables is true, i.e., only one value is assigned to the CSP variable. The multi-valued direct encoding (muldirect encoding) by Selman et al. (1992) is a variant of the direct encoding with only the at-least-one constraint. Thus, several domain values of a CSP variable can be selected by a SAT solution that gets mapped to a CSP one by choosing only one of the selected values. Alternatively, the domain of a CSP variable can be indexed with a logarithmic encoding (Iwama and Miyazaki 1994), where the number of indexing Boolean variables introduced is the ceiling of the logarithm of the domain size of a given CSP variable. The resulting structure can be viewed as a balanced ITE tree, where each ITE (“if-thenelse”) operator is a multiplexor controlled by one of the indexing Boolean variables, with the leaves of the tree being the domain values of the CSP variable. Instead of using a balanced ITE tree to index the domain values, we can use an ITE tree of any structure (Velev 2007). One extreme case is a chain of ITE operators, resulting in encoding ITE-linear, due to the linear structure of the ITE tree. A potential advantage of ITE trees that are not balanced is that they break the symmetry between the domain values. The use of hierarchical, recursive, and hybrid SAT encodings for CSP variables combine several simple SAT encodings to index the domain values of CSP variables, in order to produce SAT formulas that depend on fewer Boolean variables and are easier to solve. Namely, we can use several levels of simple SAT encodings to recursively subdivide the domain of a CSP variables into smaller subdomains, such that the lowest-level simple SAT encoding selects the domain values from each of the smallest subdomains. That is, a domain value is selected iff it gets selected in its corresponding subdomain at the lowest level in the hierarchy, and for each of the higher levels in the hierarchy, the corresponding larger subdomain that contains this value also gets selected by the SAT encoding for that level of the hierarchy. Given a domain, we can form many hierarchical encodings to index the values in that domain by varying the number of levels in the hierarchy, and the simple encoding used at each level. Using hierarchical encodings for indexing the domain values of CSP variables resulted in up to 3 orders of magnitude speedup when solving of graph-coloring problems (Velev 2007), and up to 4 orders of magnitude speedup the optimal route, combined with either a simple (de Kleer 1989; Selman et al. 1992) or a hierarchical SAT encoding (Velev 2007) to select a wavelength for that edge; 2) a tool that implements the new approach with two simple encodings and 6 types of parameterizable hierarchical encodings that can be instantiated into many specific hierarchical encodings based on the parameter values used; and 3) experimental results for routing instances with up to 3,000 nodes, 15,000 edges, and 2,048 wavelengths per edge, indicating at least 8 orders of magnitude speedup relative to the previous approach (Aloul et al. 2007b, 2008) such that the speedup is increasing with the number of nodes and edges, and the number of wavelengths per edge. Background Pseudo-Boolean SAT Solvers Most of the SAT solvers operate on the Conjunctive Normal Form (CNF) format (Johnson and Trick 1993), where Boolean formulas are represented as conjunctions of clauses, such that each clause is a disjunction of literals, and each literal is either a Boolean variable or its negation. However, restricting the input of SAT solvers to CNF formulas can limit their application. Thus, researchers have extended SAT solvers to handle more expressive input representations. Specifically, Pseudo-Boolean (PB) constraints (Aloul et al. 2007a; Chai and Kuehlmann 2005; Eén and Sörensson 2006) that are linear inequalities with integer coefficients and can be expressed in normalized form (Aloul et al. 2007a): a1 x1 + a2 x2 + } + an xn t b where ai and b are integers, and xi are literals of Boolean variables. Note that any CNF clause can be viewed as a PB constraint, e.g., (a b c) is equivalent to (a + b + c t 1). Given a set of CNF and PB constraints, one can request the minimization (or maximization) of an objective function that consists of a linear combination of the problem’s variables: n ¦ ai xi i=1 Studies have shown that PB-SAT solvers can outperform the best generic Integer Linear Programming (ILP) solvers (Aloul et al. 2007a; Chai and Kuehlmann 2005). SAT Encodings for the Domains of Constraint Satisfaction Problem Variables Next we summarize SAT encodings for the domains of Constraint Satisfaction Problem (CSP) variables. We will use these encodings for selecting a wavelength for an edge of a route in an optical network. In the direct encoding (de Kleer 1989), a new indexing 118 2E + e + i + j = 2 2F + f + j + l = 2 2G + i + k = 2 when solving detailed routing problems for complex FPGAs (Velev and Gao 2008). However, hierarchical encodings have not been applied to routing in optical networks, and thus the open research question of whether these encodings will be helpful when solving such problems. We answer this question in the current paper. The above two sets of constraints guarantee that a complete path will be formulated from the source node to the destination node. To minimize the total cost of the path, a PB objective function, consisting of all edge variables with their corresponding weights, is defined: min(2a + 2b + 3c + 4d + 2e + f + 2g + 3h + i + j + k + l) Previous Method for PB-SAT Based Optical Network Routing The general form of the objective function is: § E · min ¨ ¦ weight i u edgevar i¸ ©i = 1 ¹ We will illustrate the approach of Aloul et al. (2007b, 2008) with the network in Fig. 1. In the figure, each node is labeled by an upper-case letter, and each link is marked by (x, n) where x is the name of the link, and n is a positive integer that represents the weight (i.e., cost) of the link. Nodes I and H are the source and destination node, respectively. The objective is to find a path from I to H that will minimize the total path cost. It is assumed that every node has sufficient wavelength converters that allow each route passing through a node to use different wavelengths on the two links from the route that are connected to that node. where weighti and edgevari are the cost and variable of edge i, and E is the number of edges. Note that the objective function depends on E Boolean variables. Other objective functions can also be defined. In the case of optical networks with w wavelengths per link, Aloul et al. (2007b, 2008) express the constraints similarly by using a separate Boolean variable for each wavelength on each link in order to indicate whether that wavelength and link are on the path. The constraint for the source node I becomes: D d, 4 A e, 2 a, 2 I b, 2 B f, 1 h, 3 E i, 1 j, 1 G k, 1 a1 + a2 + ... + aw + b1 + b2 + ... H + bw + c1 + c2 + ... + cw = 1 l, 1 F where ai, bi, and ci for i = 1, ..., w are the Boolean variables for each wavelength for, respectively, edges a, b, and c. The constraint for the destination node H is modified in the same way. The constraint for node A becomes: c, 3 g, 2 C Figure 1. An example of a network with 9 nodes and 12 edges (Aloul et al. 2007b). Upper-case letters represent nodes. Lower-case letters represent edges. Each edge has an integer weight. 2A + a1 + a2 + ... + aw + d1 + d2 + ... + dw + e1 + e2 + ... + ew = 2 Two sets of variables are defined for the problem: • A Boolean variable for each node—a value of 1 (0) indicates that the corresponding node is (is not) included in the optimal path from the source to the destination node. • A Boolean variable for each edge—a value of 1 (0) indicates that the edge is (is not) on the optimal path. The following set of constraints are generated: • For each of the source and destination nodes, only one of the neighboring edges will be part of the path: a+b+c=1 The constraints for the rest of the nodes are modified in the same way. Additional constraints ensure that at most one wavelength per link can be on the path, e.g., for edge a: a1 + a2 + ... + aw d 1 The objective function is modified to depend on the variables for all wavelengths for all edges, such that the variable for each wavelength of an edge has the weight of that edge: § E § w ·· min ¨ ¦ weight i u ¨ ¦ wavelengthvar i j¸ ¸ ©i = 1 ©j=1 ¹¹ h+k+l+g=1 where weighti is the cost of edge i, and wavelengthvari, j is the variable for wavelength j of edge i. Note that now the objective function depends on E × w Boolean variables, i.e., on E × (w - 1) additional Boolean variables compared with the objective function for non-optical networks, so that the solution space has grown exponentially by a factor of 2E × (w - 1). This factor will increase with the number of edges E, and the number of wavelengths per edge w. This restricts the scalability of the above approach by Aloul et al. (2007b, 2008) for optical networks with many edges and many • Every node, except the source and destination nodes, will either be: (i) part of the path, or (ii) not part of the path. In the first case, exactly two edges connected to that node will be part of the path, and in the second case none of the edges connected to the node will be part of the path: 2A + a + d + e = 2 Similar PB constraints are generated for the other nodes: 2B + b + f = 2 2C + c + g = 2 2D + d + h = 2 119 the edge is on the optimal route. Only if an edge is on the optimal route should a wavelength from the edge be selected to be on the optimal route. In previous work, exploiting signal unobservability resulted in up to 2 orders of magnitude speedup when SAT solving Boolean formulas from formal verification of complex pipelined microprocessors (Velev 2004a – 2004e, 2005). Like Aloul et al. (2007b, 2008), we assume that every node has sufficient wavelength converters that allow each route passing through a node to use different wavelengths on the two links from the route that are connected to that node. We will use the subscript obs to indicate the observability variable for each edge. Now the constraints for the nodes will be exactly as for non-optical networks, but will depend on the observability variables—e.g., the constraints for the source node I, the destination node H, and node A will become: wavelengths per edge, as will be confirmed experimentally in the Results section. A constraint to exclude wavelength j of edge i from the optimal path, e.g., under scenarios where that wavelength on the given edge is already used for a different route, can be added as wavelengthvari, j = 0. Thus, if a network has N nodes and E edges, the encoding of Aloul et al. requires E × w + N - 2 variables and N + E constraints, such that the objective function depends on E × w Boolean variables. Furthermore, the constraint for each node now depends on approximately w times more variables, and the objective function depends on w times more variables than in the encoding for non-optical networks. This increases exponentially the complexity of satisfying the constraints and of optimizing the objective function. Namely, each additional wavelength per edge results in E additional variables in the objective function, thus increasing the size of the search space by a factor of 2E in the worst case. Also, the constraint for each node will now depend on as many additional variables as the degree of that node. All of these factors result in the limited scalability of the approach by Aloul et al. (2007b, 2008) when the numbers of nodes, edges, and wavelengths increase—see the Results section. The complexity of translating a routing instance to an equivalent PB-SAT formula is O(N + E + k) with this method, where k is the number of graph restrictions. aobs + bobs + cobs = 1 hobs + kobs + lobs + gobs = 1 2A + aobs + dobs + eobs = 2 and similarly for the other nodes. The main result is that now the node constraints do not directly dependent on the number of wavelengths per link, and neither does the objective function that depends only on the edge observability variables: min(2aobs + 2bobs + 3cobs + 4dobs + 2eobs + fobs + 2gobs + 3hobs + iobs + jobs + kobs + lobs) Previous Method for SAT Based Optical Network Routing The general form of the objective function is: § E · min ¨ ¦ weight i u obsvar i¸ ©i = 1 ¹ A method for optical network routing by using regular SAT solvers is presented by Valavi et al. (2005). They too use a Boolean variable to encode whether a node is on a route, and a set of w Boolean variables per edge per route in order to select a wavelength for the route on that edge, based on the direct encoding (de Kleer 1989). However, a pure SAT formulation does not allow the use of weights for the edges, and thus allows only to find the existence of a route, as opposed to an optimal route—that minimizes a cost function—that can be found with a PB-SAT formulation that we are using. Furthermore, the direct encoding does not scale well for many wavelengths, as determined in our experiments. Indeed, Valavi et al. present results for networks with only up to 5 wavelengths and 60 edges. In contrast, our formulation has performance that is almost invariant with the number of wavelengths, and allowed routing of instances with up to 3,000 nodes, 15,000 edges, and 2,048 wavelengths per edge. where weighti and obsvari are the cost and observability variable of edge i, and E is the number of edges. Note that now the objective function depends on E Boolean variables again, although referring to an optical network, and is independent of the number of wavelengths per edge. This reduces the number of Boolean variables with E (w 1) relative to the approach of Aloul et al. and thus reduces the solution space by a factor of 2E (w 1), i.e., an exponential reduction. The selection of a wavelength for each edge can be done with either a simple or a hierarchical encoding—e.g., if we adapt the direct encoding (de Kleer 1989), the constraint for edge a will be: aobs + a1 + a2 + ... + aw 1 i.e., either edge a is unobservable (when its observability variable aobs is 0), or else exactly one of its wavelengths has to be selected. Thus, if an edge is not selected to be on the optimal route and is unobservable, then no wavelength will be selected for that edge. Vice versa, if all wavelengths for an edge are unavailable and so their corresponding Boolean variables are set to 0, then the observability vari- Exploiting Uuobservability We extend the approach by Aloul et al. (2007b, 2008) for PB-SAT based routing in optical networks by introducing an observability variable for each edge, indicating whether 120 able for the edge will be assigned the value 0 in order for the above constraint to be satisfied, and thus the edge will not be on the optimal route. If we adapt the muldirect encoding (Selman et al. 1992), the constraint for edge a will become: Results We conducted the experiments on a Dell Precision T7400 workstation having two 3.2-GHz quad-core Intel Xeon processors with 1,600-MHz FSB, 32 GB of 800-MHz memory, and running Red Hat Enterprise Linux v5.3. Only one CPU core was used for each experiment. We used the BRITE topology generator (http:// www.cs.bu.edu/brite) to produce random networks of between 20 and 3,000 nodes. During the generation, the nodes were consecutively placed at random coordinates in a plane with a side of 1,000 units, such that each node was connected with between 2 and 5 edges (the actual number is specified for each of the benchmarks) with randomly selected nodes from those that were already in the plane, resulting in graphs of between 40 and 15,000 edges; note that the actual degree of a node will depend on how many subsequent nodes are connected to it. For the weight of each link we used its Euclidean length multiplied by a 100, since the length recorded by BRITE is a floating-point number with two digits after the decimal point. (Note that we can choose any weight for the links.) The topologies were generated based on the Waxman model (Waxman 1988) with parameters a = 0.15 and b = 0.2. The objective was to find a path that connects a given pair of nodes and has minimal cost. We compared the solvers: SAT4J.PB (Le Berre and Parrain 2007), minisat+ v1.14 (Eén and Sörensson 2006), oree3, bsolo4, borg-pb4, galena (Chai and Kuehlmann 2005), and PBS4 (Aloul et al. 2007a, 2007b, 2008; Al-Rawi and Aloul) using both its binary and linear mode. We found PBS4 with binary mode to outperform the rest, and so used it for the experiments discussed next. We implemented a program that reads a network, as well as a start and end node for a route, and an encoding to be used, and generates a PB-SAT formula that is based on either the previous encoding by Aloul et al. (2007b, 2008), or our proposed approach with edge observability variables and selection of the wavelength for each edge based on the simple encodings direct (de Kleer 1989) or muldirect (Selman et al. 1992), or the following 6 types of parameterizable hierarchical encodings: direct-n+(direct-k)*, directn+(muldirect-k)*, muldirect-n+(direct-k)*, muldirect* n+(muldirect-k) , ITE-linear-n+(direct-k)*, and ITE-linearn+(muldirect-k)*, where n is the number of indexing Boolean variables used in the simple encoding at level 1, while k is the number of indexing Boolean variables used in the simple encoding that is employed for level 2 and is repeated in subsequent levels in a multi-level hierarchical encoding. We confirmed the conclusion made by Aloul et al. (2007b, 2008) that as more wavelengths per link become unavailable, e.g., because they are included in other routes, and such constraints are modeled by randomly excluding aobs + a1 + a2 + ... + aw t 1 i.e., if edge a is unobservable (when aobs is 1) then zero or more of its wavelengths can be selected but will not be included in the solution, and if edge a is observable (selected to be on the optimal route) then the negation of aobs is 0 (i.e., aobs is 0) and so at least one of its wavelengths has to be selected, although only one will be included in the actual route. Thus, if an edge is not selected to be on the optimal route and so is unobservable, then it would not matter if a wavelength is selected for that edge. Vice versa, if all wavelengths for an edge are unavailable and so their corresponding Boolean variables are set to 0, then the observability variable for the edge will be assigned the value 0 in order for the above constraint to be satisfied, and thus the edge will not be on the optimal route. Now the mapping of a solution of the PB-SAT problem to a route is done by first identifying the edges that are selected as observable, i.e., as being on the optimal route, based on their observability variables being 1, and then choosing only one wavelength from all selected wavelengths for every observable edge. If a hierarchical encoding is used for the selection of a wavelength from an edge, the negation of the observability variable for that edge has to be added to the left hand-side of each constraint for each level of that encoding—as was done for the direct and muldirect encodings—so that the constraint will be satisfied when the edge is unobservable. Similarly, the negation of the observability variable for an edge has to be added to the left hand-side of each constraint that involves the selection of a wavelength for the edge, e.g., when a wavelength has to be excluded as unavailable. Given a SAT encoding for the selection of a wavelength per link resulting in v variables per link besides the observability variable, and c constraints for that link, our encoding results in E × (v + 1) + N - 2 variables and N + E × c constraints, such that the objective function depends on E variables, and the constraint for each node on as many edge observability variables as its degree. We can add a constraint to require that an edge be included (excluded) in a route by setting the observability variable for the edge to 1 (0). Similarly, we can add a constraint to include (exclude) a node in a route by setting the Boolean variable for the node to 1 (0). We can also add constraints to require (avoid) combinations of nodes and/or edges as part of a route. The complexity of translating a routing instance to an equivalent PB-SAT formula is now O(N + E × c + k), where k is the number of graph restrictions. 3. Pseudo-Boolean Evaluation 2007, http://www.cril.univ-artois.fr/PB07 4. Pseudo-Boolean Evaluation 2010, http://www.cril.univ-artois.fr/PB10 121 Table 1. Results for various routing instances with the previous encoding (Aloul et al. 2007b, 2008) and some of the new encodings, when the number of wavelengths per edge is increased from 8 to 2,048, using the PBS4 solver. All wavelengths for all edges were considered available in order to produce the hardest formula for each routing instance and each encoding. The abbreviation “observ” stands for observability, and is followed by the exact encoding used to select a wavelength for each edge in the new approach. For the routing instances with 2,000 and 3,000 nodes, we also include results for the performance of a portfolio of 4 parallel strategies based on 4 of the hierarchical encodings that we explored, such that the rest of the strategies are stopped as soon as one of them returns a solution; for those experiments, bold numbers indicate the best strategy for each number of wavelengths per edge. CPU Time [s] for Various Wavelengths per Edge Routing Instance Max. Speedup Encoding 8 16 32 64 128 256 512 1,024 2,048 20_2__17_12 previous 0.871 1.86 103 435 (20 nodes, 40 edges) observ, direct 0.001 0.001 0.003 0.010 11,899 >200,000 >200,000 >200,000 >200,000 0.020 0.050 0.13 0.40 1.31 observ, muldirect 0.001 0.002 0.003 0.010 0.020 0.050 0.10 0.31 0.91 observ, muldirect-3+(muldirect-3)* 0.001 0.001 0.002 0.002 0.001 0.002 0.002 0.002 0.002 observ, ITE-linear-2+(muldirect-3)* 0.001 0.001 0.002 0.001 0.002 0.002 0.002 0.002 0.002 50_2__8_45 previous 3.05 9.87 78 675 7,428 (50 nodes, 100 edges) observ, direct 0.003 0.004 0.006 0.030 0.060 21,271 >200,000 >200,000 >200,000 0.14 0.37 1.09 2.80 observ, muldirect 0.002 0.004 0.007 0.030 0.060 0.12 0.28 0.86 2.31 observ, muldirect-3+(muldirect-3)* 0.001 0.002 0.003 0.002 0.003 0.01 0.01 0.01 0.01 observ, ITE-linear-2+(muldirect-3)* 0.002 0.002 0.003 0.003 0.003 0.01 0.01 0.01 0.01 92,747 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 100_3__3_91 previous (100 nodes, 300 edges) observ, direct 0.26 0.39 0.64 1.05 2.10 5.01 16.83 43 94 observ, muldirect 0.15 0.12 0.22 0.20 0.34 0.66 1.37 2.94 6.48 observ, muldirect-3+(muldirect-3)* 0.16 0.18 0.15 0.17 0.18 0.20 0.13 0.28 0.20 observ, ITE-linear-2+(muldirect-3)* 0.14 0.20 0.10 0.17 0.13 0.24 0.13 0.18 0.19 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 500_3__212_366 previous (500 nodes, 1,500 edges) observ, direct 1.72 2.51 4.46 11.02 29.14 70 140 286 observ, muldirect 1.18 0.92 2.07 3.19 2.26 5.51 12 20 39 observ, muldirect-3+(muldirect-3)* 0.99 0.59 1.49 0.67 1.74 0.59 1.07 1.11 0.83 1.35 0.89 1.39 0.89 2.47 1.77 0.89 1.16 0.61 observ, ITE-linear-2+(muldirect-3)* (2,000 nodes, 10,000 edges) observ, muldirect-3+(muldirect-3)* 404 459 505 610 713 643 522 249 223 observ, ITE-linear-2+(muldirect-3)* 538 457 815 538 350 539 389 273 317 observ, muldirect-7+(muldirect-3)* 515 686 660 684 607 604 449 240 487 observ, ITE-linear-5+(muldirect-6)* 560 608 529 382 678 818 430 280 395 parallel portfolio: above 4 strategies 404 457 505 382 350 539 389 240 223 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 mem. out 3000_5__126_2812 previous (3,000 nodes, 15,000 edges) >107 >106 >105 584 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 >200,000 mem. out 2000_5__647_1792 previous >108 observ, muldirect-3+(muldirect-3)* 1,009 500 651 373 374 163 220 252 227 observ, ITE-linear-2+(muldirect-3)* 499 180 386 576 138 1,017 198 118 103 observ, muldirect-7+(muldirect-3)* 398 862 155 306 278 242 277 137 254 observ, ITE-linear-5+(muldirect-6)* 811 271 622 322 241 263 215 99 112 parallel portfolio: above 4 strategies 398 180 155 306 138 163 198 99 103 >897 >2,020 Table 2. Detailed results for routing instance 500_3__212_366 with the previous encoding (Aloul et al. 2007b, 2008) and four of the new encodings for 2,048 wavelengths per edge, using the PBS4 solver. All wavelengths for all edges were considered available in order to produce the hardest formula for each encoding. The abbreviation “observ” stands for observability, and is followed by the exact encoding used to select a wavelength for each edge in the new approach. 500_3__212_366 (500 nodes, 1,500 edges) Solving with PBS4 PB-SAT Formula Routing Instance Encoding Variables Constraints File Size [MB] Decisions Conflicts Implications CPU Time [s] previous 3,072,498 2,000 183 ? ? ? >200,000 observ, direct 3,073,998 2,000 43 12,327 2,516 1,908,688,004 584 observ, muldirect 3,073,998 2,000 43 3,089,053 1,939 7,998,279 39 observ, muldirect-3+(muldirect-3)* 33,498 12,500 0.83 111,365 1,453 1,341,374 0.83 observ, ITE-linear-2+(muldirect-3)* 31,998 11,000 0.76 114,008 904 890,472 0.61 122 file size by a factor of approximately 50, and produces a similar speedup, resulting in execution times of less than a second. We found encoding muldirect-n+(muldirect-k)* to outperform direct-n+(direct-k)*, direct-n+(muldirect-k)*, and muldirect-n+(direct-k)*; and encoding ITE-linear-n+(muldirect-k)* to outperform ITE-linear-n+(direct-k)*. Thus, multi-valued hierarchical encodings result in constraints that are easier to satisfy. The availability of many efficient encodings allows us to use them in portfolios of strategies to be run in parallel on multi-core CPUs, with the rest of the strategies stopped as soon as one of them finds a solution. For the routing instances with 2,000, and 3,000 nodes, Table 1 presents results from a portfolio of 4 parallel strategies, each based on using observability variables and a different hierarchical encoding. This portfolio resulted in speedup of up to 6 times relative to each of the strategies executed independently (see a run time of 1,017 seconds with one of the strategies and 163 seconds with the portfolio for the instance with 3,000 nodes and 256 wavelengths) and also reduced the variability of the run times. We will investigate such portfolios in our future work. wavelengths, the resulting PB-SAT formulas become much easier to solve. That is why we conducted experiments assuming that all wavelengths per link are available, thus generating the hardest formula for each routing instance and encoding. Table 1 presents the results for 6 routing instances. An instance N_L__A_B indicates that the network has N nodes that were each connected with L random links with previously added nodes when the topology was generated by BRITE, and the route is from node A to node B. The first three instances were also used by Aloul et al. (2007b, 2008), such that they presented results for only 5 and 10 wavelengths per edge for the first two instances, and only 5 wavelengths per edge for the third. Indeed, as the results in Table 1 indicate, the previous encoding takes 11,899 seconds for the routing instance 20_2__17_12 with 128 wavelengths, and requires more than 200,000 seconds for 256 – 2,048 wavelengths. In contrast, our approach takes 1.31 seconds for 2,048 wavelengths per edge when observability variables are combined with the direct encoding. Furthermore, the execution time is reduced to only 0.002 seconds when edge observability is combined with the hierarchical encodings muldirect-3+(muldirect-3)* or ITE-linear2+(muldirect-3)* to select the wavelength for each edge, i.e., a speedup of more than 108 times. The results are similar for the routing instance 50_2__8_45. Thus, our approach results in at least 8 orders of magnitude speedup, such that the speedup is increasing with the number of nodes and edges in the network, and the number of wavelengths per edge. Furthermore, the hierarchical encodings result in very little variation of the CPU time when the number of wavelengths increases, compared to the previous approach. Also, the previous approach took more than 24 h for the instance with 100 nodes, 300 edges, and 8 wavelengths. As shown in Table 1 for the routing instance with 500 nodes, 500_3__212_366, when the number of wavelengths ranges between 512 and 2,048, combining edge observability with the muldirect encoding instead of the direct encoding produces an order of magnitude speedup, followed by another order of magnitude speedup if one of the above two hierarchical encodings is used. Detailed statistics for this routing instance and 2,048 wavelengths per edge are presented in Table 2. As can be seen, the use of observability variables, combined with the direct encoding, reduces the file size for the PB-SAT formula by approximately 4.5 times, and the CPU time for solving it from over 200,000 seconds to 584 seconds. Using the muldirect encoding increases the number of decisions, but also reduces the number of implications—which have been shown to consume up to 90% of the execution time of SAT solvers (Moskewicz et al. 2001)—and produces a speedup of approximately 15 times relative to the direct encoding. Using the two hierarchical encodings further reduces the Conclusion We proposed a novel method for combined Routing and Wavelength Assignment (RWA) in optical networks by reformulation to an equivalent PB-SAT problem that can be solved with any state-of-the-art PB-SAT solver. We introduced edge observability variables to represent whether an edge is part of an optimal route, combined with either a simple or a hierarchical SAT encoding to select a wavelength for that edge only when the edge is on the route. This translation exponentially reduces the size of the solution space, making it independent of the number of wavelengths per link for any PB-SAT solver that is used. We presented results for networks with up to 3,000 nodes, 15,000 edges, and 2,048 wavelengths per edge. We achieved at least 8 orders of magnitude speedup relative to the previous PBSAT formulation by Aloul et al. (2007b, 2008), such that the speedup is increasing with the number of nodes and edges in the network, and the number of wavelengths per edge. Furthermore, the hierarchical encodings result in very little variation of the CPU time when the number of wavelengths increases, compared to the previous encoding. A portfolio of 4 parallel strategies, each based on the new approach and a different hierarchical encoding, resulted in additional speedup of up to 6 times, and also reduced the variability of the run times. References Aloul, F. A.; Ramani, A.; Markov, I.; and Sakallah, K. 2007a. 123 Velev, M. N. 2004b. Efficient Translation of Boolean Formulas to CNF in Formal Verification of Microprocessors. In Proceedings of the Asia and South Pacific Design Automation Conference (ASP-DAC ’04), 310–315. Velev, M. N. 2004c. Exploiting Signal Unobservability for Efficient Translation to CNF in Formal Verification of Microprocessors. In Proceedings of Design, Automation and Test in Europe (DATE ’04), 266–271. Velev, M. N. 2004d. Encoding Global Unobservability for Efficient Translation to SAT. In Proceedings of the 7th International Conference on Theory and Applications of Satisfiability Testing (SAT ’04), 197–204. Velev, M. N. 2004e. Comparative Study of Strategies for Formal Verification of High-Level Processors. In Proceedings of the 22nd International Conference on Computer Design (ICCD ’04), 119– 124. Velev, M. N. 2005. Comparison of Schemes for Encoding Unobservability in Translation to SAT. In Proceedings of the Asia and South Pacific Design Automation Conference (ASP-DAC ’05), 1056–1059. Velev, M. N. 2007. Exploiting Hierarchy and Structure to Efficiently Solve Graph Coloring as SAT. In Proceedings of the International Conference on Computer-Aided Design (ICCAD ’07), 135–142. Velev, M. N.; and Gao, P. 2008. Comparison of Boolean Satisfiability Encodings on FPGA Detailed Routing Problems. In Proceedings of the Design, Automation and Test in Europe (DATE ’08), 1268–1273. Waxman, B. M. 1988. Routing of Multipoint Connections. IEEE J. on Selected Areas in Communications 6(9): 1617–1622. Xing, Z.; Chen, Y.; and Zhang, W. 2006. MaxPlan: Optimal Planning by Decomposed Satisfiability and Backward Reduction. In Proceedings of the International Conference on Automated Planning and Scheduling (ICAPS ’06), 53–56. Solution and Optimization of Systems of Pseudo-Boolean Constraints. IEEE Transactions on Computers 56(10): 1415–1424. Aloul, F. A.; Al-Rawi, B.; and Aboelaze, M. 2007b. Routing in Optical and Non-Optical Networks using Boolean Satisfiability. Journal of Communications 2(4): 49–56. Aloul, F. A.; Al-Rawi, B.; and Aboelaze, M. 2008. Routing and Wavelength Assignment in Optical Networks Using Boolean Satisfiability. In Proceedings of the Fifth IEEE Consumer Communications & Networking Conference (CCNC ’08), 185–189. Al-Rawi, B. A.; and Aloul, F. A. PBS4 SAT Solver, http:// www.aloul.net/Tools/pbs4. Chai, D.; and Kuehlmann, A. 2005. A Fast Pseudo-Boolean Constraint Solver. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 24(3): 305–317. de Kleer, J. 1989. A Comparison of ATMS and CSP Techniques. In Proceedings of the 11th International Joint Conference on Artificial Intelligence (IJCAI ’89), 290–296. Dijkstra, E. W. 1959. A Note on Two Problems in Connection with Graphs. Numerical Mathematics 1: 269–271. Eén, N.; and N. Sörensson, N. 2006. Translating Pseudo-Boolean Constraints into SAT. Journal on Satisfiability, Boolean Modeling and Computation 2(1–4): 1–25. Huitema, C. 1999. Routing in the Internet, 2nd ed., Prentice Hall, Upper Saddle River, NJ, U.S.A. Iwama, K.; and Miyazaki, S. 1994. SAT-Varible Complexity of Hard Combinatorial Problems. IFIP 13th World Computer Congress, (1): 253–258. Johnson, D. S., and Trick, M. A. eds. 1993. The Second DIMACS Implementation Challenge. DIMACS Series in Discrete Mathematics and Theoretical Computer Science. http://dimacs.rutgers.edu/Challenges. Kautz, H.; et al. SATPLAN: Planning as Satisfiability. http:// www.cs.washington.edu/homes/kautz/satplan/index.htm. Le Berre, D.; and Parrain, A. 2007. On Extending SAT Solvers for PB Problems. In Proceedings of the 14th RCRA Workshop Experimental Evaluation of Algorithms for Solving Problems with Combinatorial Explosion. Moskewicz, M. W.; Madigan, C. F.; Zhao, Y.; Zhang, L.; and Malik, S. 2001. Chaff: Engineering an Efficient SAT Solver. In Proceedings of the Design Automation Conference (DAC ’01), 530–535. Ramaswami, R.; and Sivarajan, K. 2001. Optical Networks: A Practical Perspective, 2nd ed., Morgan Kaufmann. Subranmanian, S.; and Muthukumar, V. 2003. Alternate Path Routing Algorithm for Traffic Engineering in the Internet. In Proceedings of the International Conference on Information Technology: Coding and Computing (ITCC ’03), 367–372. Selman, B.; Levesque, H.; and Mitchell, D. 1992. A New Method for Solving Hard Satisfiability Problems. In Proceedings of the Tenth National Conference on Artificial Intelligence, 440–446. Valavi, J.; Saluja, N.; and Khatri, S.P. 2005. A Boolean Satisfiability Based Solution to the Routing and Wavelength Assignment Problem in Optical Telecommunication Networks. In Proceedings of the IEEE International Conference on Communications (ICC ’05), 3: 1802–1806. Velev, M. N. 2004a. Using Automatic Case Splits and Efficient CNF Translation to Guide a SAT-Solver When Formally Verifying Out-of-Order Processors. In Proceedings of Artificial Intelligence and Mathematics (AI&MATH ’04), 242–254. 124