The Treewidth of Induced Graphs of Conditional Preference Networks Is Small

: Conditional preference networks (CP-nets) are recently an emerging topic as a graphical model for compactly representing ordinal conditional preference relations on multi-attribute domains. As we know, the treewidth, which can decrease the solving complexity for many intractability problems, is exactly a fundamental property of a graph. Therefore, we can utilize treewidth to solve some reasoning tasks on induced graphs, such as the dominance queries on the CP-nets in the future. In this paper, we present an efﬁcient algorithm for computing the treewidth of induced graphs of CP-nets; what we need is to make an assumption that the induced graph of a CP-net has been given. Then, we can leverage the Bucket Elimination technique to solve treewidth within polynomial time. At last, it is revealed that by our experiment, the treewidth of induced graphs of CP-nets is much smaller with regard to the number of vertices. For example, for an induced graph of CP-net with 1024 vertices, its treewidth is only 10. As far as we know, this is the ﬁrst time, using the Bucket Elimination , to compute the treewidth of an induced graph of a CP-net. This approach for solving the treewidth may lay a good foundation for efﬁciently solving dominance queries on CP-nets in the future.


Introduction
Conditional preference networks (CP-nets) [1,2] have permeated our daily life as a specific graphical model.As a novel graphical tool, it has been used for representation and reasoning preference by the intuitive and compact preference statements since 1999.Recently, CP-nets have also played a crucial role in the areas of decision theory [3,4], recommender systems [5], and databases [6].Many graph problems, however, are NP-hard [7]; the induced graphs of CP-nets are no exception.Parameter calculation theory [8,9] has provided strong support to solve NP-hard problems in recent years.Treewidth was coined by Robertson and Seymour on graph minors [10], which provides some new ideas for researching graphical models, such as probabilistic reasoning, constraint satisfaction, and knowledge representation and reasoning.CP-nets are a graphical model for compactly representing conditional qualitative preference relations [1,11].Therefore, various queries and operations have been carried out on the induced graphs of CP-nets.It is well known that most combinatorial optimization problems are NP-complete problems.Luckily, however, these NP-complete problems will be solved in polynomial time if the treewidth of the input graph is bounded by a constant.Namely, ordering queries and dominance queries with respect to acyclic CP-nets will be answered efficiently in the number of variables if the treewidth of induced graphs of CP-nets have been obtained.
In this paper, we investigate how to compute the treewidth of induced graphs of CP-nets in Section 4.2.When the treewidth of induced graphs of CP-nets is computed by our algorithm, some

Treewidth
The notion of treewidth was introduced by Robertson and Seymour in their work on graph minors [10].Definition 1.A tree decomposition of a graph G = (V, E) is a pair (X, T), where {X i ∈ X | i = 1, • • • , n} is a set of subsets of V, and T is a tree.Also, each node of T is exactly equal to an arbitrary subset of X.The (X, T) possess the following properties: (i) i∈T X i = V.That is, each graph vertex is contained in at least one tree node.(ii) If vertices v and w both are connected in a graph G, then v and w are contained in at least one subset X i .(iii) Considering the three nodes i, j, k in the tree, when j exists in the path of i and k,X i X k ⊆ X j , that is, common vertices of i and k must appear in the j.
Definition 2. The width of tree decomposition D = (X, T) equals max X i ∈X | X i | −1, and the minimum width of a tree decomposition of G is the treewidth of the graph G.
Figure 1 shows a graph G and one of its tree decompositions; from it, we can draw the result that the width of the tree decomposition is two.
In fact, treewidth has a close relationship with chordal graphs [14], and they have a special tree decomposition called a clique tree.So, we can further give an equivalent definition of treewidth: the treewidth of G is one less than the size of the largest clique in the chordal graph containing G with the smallest clique number.A chordal graph with this clique size may be obtained by adding an edge between every two vertices that both belong to at least one of the sets X i .Actually, the treewidth of some graphs is determinate, and the graphs for which treewidth is easier to compute are those with a known constant treewidth.For example, tree structure is a special kind of graph, and its treewidth is 1.A complete graph, or a clique with n vertices, is the least tree-like type of graph; it has a treewidth of n − 1 [15].Moreover, series-parallel graphs (SPG) have a treewidth of 2, and a treewidth of m−grid is m [16].There are other types of graphs that do not have constant treewidth, but for which the treewidth can be found in polynomial time.One example is the chordal graph, or triangulated graph.Although determining the treewidth of an arbitrary graph is NP-complete [17], in practical application, we can use heuristic algorithms to construct tree decomposition, thus obtaining its approximate optimal treewidth.In past research, Bucket Elimination and Separator techniques [18] have often been used in these heuristic algorithms.In this paper, we will concentrate on computing the treewidth of induced graphs of CP-nets, and illustrate in detail how to use Bucket Elimination to obtain treewidth in the next section.

CP-nets
We assume that readers are familiar with standard notions of CP-nets; next, we review the basics of CP-nets briefly.
Let V = {X 1 , • • • , X n } be a set of variables.Dom(X i ) indicates the sets of variables of X i , and |Dom(X i )| denotes its size.Ω = × n i=1 Dom(X i ) denotes all combinations of variables.The size |Ω| = ∏ n i=1 Dom(X i ) denotes the total number of outcomes.Any two outcomes o, o ∈ Ω are regarded as swap outcomes if and only if they have only one different attribute value.If X i is preferred over X j then, X j is a parent node of X i .We define Pa(X i ) as the parents set of X i .
, whose nodes are annotated with conditional preference tables CPT(X i ) for each X i ∈ V.Each conditional preference table CPT(X i ) express the preference on Dom(X i ) with respect to different assignments on the variable set Pa(X i ).
Definition 4. Let N =< V, E > be a CP-net, then the corresponding directed graph N =< Ω, IE > is called the induced graph of N, where IE is the directed edges set indicating all the swapping relations.The induced graph N has |Ω| nodes, considering the antisymmetry of the preference relation; there also are at most n|Ω|/2 edges in the induced graph of N.
Here we use a group of examples to illustrate the semantics of CP-net and its induced graph.
Example 1.Consider the simple CP-net in Figure 2 that expresses my preference of weekend activities.This network consists of two variables, W and P, standing for the weather and plan, respectively.Now, I strictly prefer sunny (W s ) to rainy (W r ), while my preference between film (P f ) and ball (P b ) is conditioned on the weather to be served: I prefer playing basketball if served a sunny day, and seeing a film if served a rainy day.
Figure 2 shows the preference graph over outcomes induced by this CP-net.An arrow in this graph directed from outcome o i to o j indicates that a preference for o i over o j can be determined directly from one of the CPT s in the CP-net.For example, the fact that W s P b is preferred to W s P f (as indicated by the direct arrow between them) is a direct consequence of the semantics of CPT(P).The top-left element (W s P b ) is the best outcome, while the bottom-left element (W r P b ) is the worst.Next, we will give a complicated example of a CP-net.
Example 2. Figure 3 illustrates another CP-net that expresses my preferences for the weekend.It consists of four variables, M, W, P, and R, standing for mood, weather, plan, and rest, respectively.With the underlying assumption that I always prefer a good mood to a bad mood, and good weather is preferred to bad weather.While my preference between the film and ball is conditioned on the combination of mood and weather, if I am happy and the weather is sunny, or I am not happy and the weather is rain, then playing basketball is my choice rather than film.Otherwise, I will go to a film.Finally, if I choose to play basketball, then I will take a bath to relax.On the contrary, I might have a big meal.Figure 4 shows the corresponding induced graph of the CP-net shown in Figure 3.  Through the example above, we can see that the structure of the induced graph becomes more complex with the increase in the number of variables of CP-nets.At this moment, treewidth, as an important property, can naturally be used in the induced graphs of CP-nets.

Related Work
Given a set of attributes, CP-nets can not only express users' preferences, but also indicate the relationships between them.Pervious work has mainly focused on learning and reasoning CP-nets.For example, how to express a user's preferences in database queries [19], how to solve the expressive power on two kinds of specific CP-nets [2].Guerin [20] presented an online heuristic algorithm for learning CP-nets from user queries, however, their algorithm does not always converge to the original CP-nets.Bigot et al. [21] studied how probabilistic conditional preference networks can be learnt, both in off-line and on-line settings.It is interesting to learn not a single model, but a probabilistic model that can compactly represent the preferences of a group of users.Liu et al. [22] studied conditional preference in recommender systems.Goldsmith et al. [23] researched the computational complexity of testing dominance and consistency in CP-nets, and proved that both dominance and consistency for general CP-nets are PSPACE-complete.Up to now, there has been little research investigating the structural properties of the induced graph of CP-nets, because its structure is rather complicated.As we know, the treewidth is interpreted as a significant property of arbitrary graphs in the study of Graph Minor.If the treewidth of a graph is obtained, we can perform some efficient reasoning over the induced graphs of CP-nets.
There are some papers working on determining treewidth and finding the optimal tree-decompositions.Given a graph G and an integer k, it is NP-complete to decide whether the treewidth of G is at most k or not [17].Bodlaender et al. [24] proved that the treewidth problem is NP-complete for graphs with small maximum degree.The paper [25] gave a linear time algorithm that either outputs a tree-decomposition of G with treewidth at most k or determines that the treewidth of G is larger than k, for all constant k.For the Minimum Spanning Caterpillar Problem for bounded treewidth graphs, Dinneen and Khosravani [26] gave a linear time algorithm to solve it, but they assume that an approximate tree-decomposition of width bounded by a constant is given.Moreover, the treewidth problem of cographs [27], circular arc graphs [28], and chordal bipartite graphs [29], are polynomial solvable.However, so far, there are no papers to research the character of treewidth of the induced graphs of CP-nets.
As we all know, treewidth always has a parameterized complexity result on graphical models.Koster et al. [30] studied how to use tree decomposition to solve combinatorial optimization problems.In addition, Zhao et al. [31,32] published two papers that exploit tree decomposition to solve some problems about computational biology.In the area of graphical models, including knowledge representation and reasoning, probabilistic reasoning, and constraint satisfaction [33,34], all these studies focused on some graphs to represent abundant information about the real world.Since CP-nets can represent and reason users' preference represented by graphical model, treewidth can be applied in CP-nets naturally.In this paper, we study the treewidth problem on the induced graphs of CP-nets.Through the experiment in Section 5.2, we believe that any treewidth of the induced graph of a CP-net is small.
From Boutilier et al.'s paper [1], we know that there are four different paths from the outcome āb c to the outcome abc in the induced graph.Our purpose is to find an optimal flipping sequence for abc āb c; that is, to find the shortest path from these four paths.Fortunately, we can compute all-pairs shortest paths in induced graphs by leveraging low treewidth [35].Since we have found that the treewidth of the induced graphs of CP-nets is small, we can quickly find the shortest path (optimal flipping sequence) in the induced graph.Therefore, solving dominance queries on the CP-nets is efficient.

Treewidth of the Induced Graphs of CP-nets
In this section, we mainly introduce the process of Bucket Elimination to solve treewidth, and a detailed algorithm pseudo-code.

Bucket Elimination Technique
The so-called elimination means that the vertices in a undirected graph are continuously eliminated, and how to get the vertex elimination order over the vertices is crucial in solving the treewidth.The notion of finding optimal vertex elimination orders is based on Bertele and Brioschi's [36] work on non-serial dynamic programming.This idea plays a role in a variety of algorithms in graphical models.
We begin with a series of definitions to explain the notion of Bucket Elimination in detail.First of all, we define the operation of eliminating a vertex from a graph as the process of adding an age between every pair of a vertex's neighbours that are not already adjacent, then removing the vertex and all edges incident to it.
A vertex elimination order over the vertices in a graph is a total order.When we eliminate some vertices, a group of graphs come into being.Clearly, the vertex elimination order is an total order on the given graph with n vertices.We would count an elimination order by its width, with the underlying assumption that we gain the elimination order π = (C, A, B, D, E).The width of an elimination order is defined as the maximum degree of any vertex when it is eliminated from the graph.For example, the width of π is the maximal of these values in Figure 5; namely, width(π) = max(4, 2, 2, 1, 0) = 4.An elimination order can determine only one width, the number of total vertex elimination orders of a graph with n vertices is n!.Importantly, the treewidth of a graph is the minimum width over all elimination orders, or, in other words, we must find an optimal vertex elimination order so that we can accurately conclude the treewidth of a graph.In Figure 6, the elimination order π opt = (A, B, C, D, E) is optimal.Notice that there is more than one optimal vertex elimination order.Finally, we have the following equation: We give the quantitative characterization of the number of attributes of CP-nets, the number of vertices of the induced graph, and the number of elimination orders in Figure 7.In fact, the elimination orders selected by our algorithm is a certain constant but exponential.Due to the fact that the induced graph of a CP-net is a special kind graph, and when the variable number is only 7, the number of total elimination orders is extremely large.So, we can not compute the width of all elimination orders to gain the treewidth of a graph in a practical application.According to the characteristics of randomness, we randomly select a certain number of vertex elimination orders to compute the treewidth of induced graphs.A simple example computing the treewidth of an induced graph with 4 vertices, is shown in Section 4.3.While the number of vertices is large enough, the consumption of time and resources are also huge.However, there exists many specific graphs whose treewidth are constants or small [37].Therefore, in practical application, we only need to solve the approximate optimal treewidth of graphs by some specific heuristic approach.Next, an example solving the treewidth of an induced graph will be given.Notice that, for the graph with five vertices in Figure 8, the number of total elimination orders is 120, Figure 9 only give one fifth of these 120 elimination order.
Fractional vertex elimination orders of Figure 8.
Given the number of elimination orders, we randomly select the vertices orders to solve the treewidth of this graph.In the next section, we describe this algorithm.

Algorithm for the Treewidth of an Induced Graph
Here we focus on our thought of the algorithm.First, Liu and Liao [2] gave the definition of induced graphs of CP-nets, which is derived from the CP-nets based on ceteris paribus semantics.So, it is assumed that, the induced graphs of CP-nets have not only been solved by the approach of literature [2] in advance, but has also been converted into an adjacency matrix of the corresponding underlying graph, so the adjacency matrix is the parameters of our algorithm.Since its vertex elimination orders are n!, in the program, we do not calculate the width of total vertex elimination orders.This reason has been explained in Section 4.1.Next, a certain amount of random vertex elimination orders are obtained.Then, this algorithm works by iterating through all sets of vertex elimination orders in order to find the approximate optimal treewidth.For instance, we in turn compute the degree of each vertex from the elimination order π = (B, A, C, D, E).The function for solving the degree of the vertex is named Deg().The adjacency matrix will be changed every time the degree of one vertex has been obtained, which will be accomplished in the ChangeMatrix() function.At the same time, we take the maximum degree in the set of vertex elimination order as the width of this order.Finally, the minimum selected from all widths of vertex elimination orders is the treewidth of a graph.The pseudo-code of the proposed algorithm is summarized in Algorithm 1.
Algorithm 1: solving treewidth of included graphs of CP-nets N .

Input: An adjacency matrix
// Calculate the total number of vertex elimination order sum.
4 foreach m ← 1 to sum do // Calculate the width of vertex elimination order in turn in term of the order produced randomly.

A Motivate Example
Now, we give a motivate example to demonstrate the solving procedure for Algorithm 1 in detail.In Figure 2, there are two binary-valued variables, and its induced graph has four vertices.For simplicity, let A, B, C, and D stand for these outcomes (W s P b , W s P f ,W r P f , and W r P b ), respectively.Initially, the induced graph was converted into a undirected graph stored in the 4 by 4 adjacency matrix.If there is a relationship between two vertices, the corresponding value in the adjacency matrix is set to 1. Otherwise, the value is set to 0, and the number of total elimination orders is 24.The program randomly selects half of the total amounts; namely, the practical number of elimination orders is 12.For example, π 1 = (D, B, A, C) and width(π 1 ) = max(2, 2, 1, 0) = 2, π 4 = (B, A, D, C) and width(π 4 ) = max(2, 2, 1, 0) = 2, and π 10 = (D, A, B, C), and width(π 10 ) = max(2, 2, 1, 0) = 2, etc.Finally, the smallest value we work out as above is the treewidth of this induced graph.Table 1 shows the results with different elimination orders.Obviously, the treewidth is 2 in terms of our algorithm.
In addition, the treewidth of induced graph of given CP-net is 5 in Figure 4 by Algorithm 1.

Time Complexity Analysis
Theorem 1.The time complexity of Algorithm 1 is O(c The variable n is the number of vertices of the induced graphs of CP-nets, c 1 is a certain constant of randomly generated but exponential elimination orders (please refer to Section 4.1 on how to choose c 1 ), and c 2 is the maximal in-degree of the induced graph.
Proof.In Algorithm 1, firstly, we arbitrary select some vertex elimination orders from c 1 orders.this has ( c 1 1 ) = c 1 kinds of selection methods.Secondly, to compute the treewidth of the induced graph, we need to iterate through all the vertices set n.Then, we compute the degree of this vertex when eliminating each vertex, its time complexity is O(n).At the same time, the change of adjacency matrix includes two parts.One iterates through all the vertices to judge whether there is a relationship between arbitrary vertex, the other forms a clique which consists of all the vertices having a relationship with the deleted vertex.The time complexity of this process is O(n + c 2 ).Finally, the minimum selected from all widths of vertex elimination orders is the treewidth of the induced graph.Therefore, combined with the three steps, the execution time in Algorithm 1 is: According to the above analysis, the time complexity of Algorithm 1 is O(c 1 n 2 + c 1 c 2 n).

Experimental Environment
Our algorithm was implemented in C++ and went through an intensive profiling phase.The experiments were run using Microsoft Visual Studio 2008, on a Lenovo V480 running 64-bit Windows 8 equipped with 4GB DDR3 memory and dominant frequency of 2.4GHz i5-Intel CPU.The run times are averaged over 10 runs for each unique problem instance.Moreover, we generated several different instances for each given induced graph model.Finally, each induced graph instances was ensured to compute the accurate treewidth.

Experimental Results on Simulated Data
In this section, we comment on the experiments we have carried out for the Bucket Elimination algorithm for computing the treewidth of the given induced graph in Table 2. Firstly, we define the size |E 1 | of a induced graph N as the total number of edges in N , and we already know that |E 1 | = n|Ω|/2 by Definition 4.Moreover, we also define the size |E 2 | of a graph with n vertices as the total number of edges.
Table 3 shows the relationship between V, n, |E 1 |, and |E 2 |, where V and n denote the size of the variables of CP-nets and of the vertices of the induced graph, respectively.The size of |E 2 | is much more than |E 1 |'s; thus, when computing the treewidth of the induced graphs of CP-nets, we need not consider too many edges.Apparently, it improves the running efficiency of the program.Table 2 lists the number of test cases, the range of the number of vertices n, edges |E|, time, as well as induced graphs with treewidth tw produced by Algorithm 1.More details on the different sets can be found below, but one thing that stands out immediately is that when the number of edges is different in the same induced graph, treewidth is not necessarily equal, and with an increase in the number of edges, treewidth gradually becomes larger.In Figure 10, it is more intuitive to express the relationship between the treewidth of an induced graph and the number of edges in the induced graph with 16 vertices and different edges.For the induced graph of a CP-net with 1024 vertices, though we have randomly generated ten thousand elimination orders to solve treewidth, it is far less than the total elimination orders.Therefore, in this situation, the treewidth of the induced graph of a CP-net calculated by our algorithm could not be regarded as the accurate value, but it can be regarded as the upper bound of treewidth.It also comes to the conclusion that the treewidth of the induced graphs of CP-nets is still small when it has too many vertices.

Conclusions and Future Work
We know that some search algorithms can be used to traverse the improving search tree to find an improving sequence that supports dominance queries [1]-it means that we should find an optimal path over the induced graph.However, when the treewidth of a graph is small, an optimal path will be easier to find.Just as we have shown that the treewidth of induced graphs of CP-nets is much smaller in Section 5.2, so, dominance queries may be solved efficiently.
In this paper, we use a Bucket Elimination to compute the treewidth of the induced graphs of CP-nets.Although the time complexity of a Bucket Elimination is exponential in the treewidth of the given induced graphs of CP-nets, we randomly select a certain number of vertex elimination orders according to the characteristics of randomness, and the number of edges of the induced graphs of CP-nets is finite, which not only improves running time but also computes accurate treewidth of the induced graphs of CP-nets.Also, our research will make some operations over the induced graphs of CP-nets more feasible.
As everyone knows, program parallelization is getting more and more attention in recent years.Running on a multi-core computer is obviously much faster than on a single core.Then, we would implement the algorithm in parallel to improve the efficiency of computing the treewidth of the induced graphs of CP-nets in the near future.
Recently, a dynamic programming of the style of the classic Held-Karp algorithm has been given for the Traveling Salesman Problem [18], and Shoikhet and Geiger [38] have suggested that an algorithm of Arnborg et al. [38] can be used to compute treewidth.This algorithm builds a tree decomposition, and also leverages the dynamic programming idea.We would also like to compare our algorithms to the above dynamic algorithms experimentally in future work.Furthermore, in this paper, the induced graph of CP-net has been converted to undirected graph to compute its treewidth.
Our research would pay attention to how to compute the treewidth of directed induced graphs of CP-net-this will also be an interesting question in the future.

Figure 1 .
Figure 1.Graph G and its tree decomposition.

Figure 4 .
Figure 4.The induced graph of the CP-net "My Weekend 1".

Figure 5 .
Figure 5.A five vertices graph for finding treewidth by eliminating vertices with the vertex elimination order π = (C, A, B, D, E).

Figure 6 .
Figure 6.Finding the treewidth of a five vertices graph by eliminating vertices with the vertex elimination order π opt = (A, B, C, D, E) .

Figure 8 .
Figure 8.A graph on which we find the treewidth.

Figure 10 .
Figure 10.Treewidth corresponding to different edges in a given induced graph with 16 vertices.
|V|, |N| and |π| are the number of variables of CP-nets, vertices of induced graphs, and elimination orders, respectively.

Table 1 .
The width in different elimination orders.

Table 2 .
Experimental results of the induced graphs of CP-nets.